@@ -37,32 +37,32 @@ def __init__(
3737 self ,
3838 dbgym_workspace : DBGymWorkspace ,
3939 pgport : int ,
40- pristine_dbdata_snapshot_fpath : Path ,
40+ pristine_dbdata_snapshot_path : Path ,
4141 dbdata_parent_dpath : Path ,
4242 pgbin_path : Union [str , Path ],
4343 # Whether this is None determines whether Boot is enabled.
44- boot_config_fpath : Optional [Path ],
44+ boot_config_path : Optional [Path ],
4545 ) -> None :
4646
4747 self .dbgym_workspace = dbgym_workspace
4848 self .pgport = pgport
4949 self .pgbin_path = pgbin_path
50- self .boot_config_fpath = boot_config_fpath
50+ self .boot_config_path = boot_config_path
5151 self .log_step = 0
5252
5353 # All the paths related to dbdata
54- # pristine_dbdata_snapshot_fpath is the .tgz snapshot that represents the starting state
54+ # pristine_dbdata_snapshot_path is the .tgz snapshot that represents the starting state
5555 # of the database (with the default configuration). It is generated by a call to
5656 # `python tune.py dbms postgres ...` and should not be overwritten.
57- self .pristine_dbdata_snapshot_fpath = pristine_dbdata_snapshot_fpath
58- # checkpoint_dbdata_snapshot_fpath is the .tgz snapshot that represents the current
57+ self .pristine_dbdata_snapshot_path = pristine_dbdata_snapshot_path
58+ # checkpoint_dbdata_snapshot_path is the .tgz snapshot that represents the current
5959 # state of the database as it is being tuned. It is generated while tuning and is
6060 # discarded once tuning is completed.
61- self .checkpoint_dbdata_snapshot_fpath = (
61+ self .checkpoint_dbdata_snapshot_path = (
6262 dbgym_workspace .dbgym_tmp_path / "checkpoint_dbdata.tgz"
6363 )
6464 # dbdata_parent_dpath is the parent directory of the dbdata that is *actively being tuned*.
65- # It is *not* the parent directory of pristine_dbdata_snapshot_fpath .
65+ # It is *not* the parent directory of pristine_dbdata_snapshot_path .
6666 # Setting this lets us control the hardware device dbdata is built on (e.g. HDD vs. SSD).
6767 self .dbdata_parent_dpath = dbdata_parent_dpath
6868 # dbdata_dpath is the dbdata that is *actively being tuned*
@@ -102,16 +102,16 @@ def disconnect(self) -> None:
102102 self ._conn = None
103103
104104 def move_log (self ) -> None :
105- pglog_fpath = (
105+ pglog_path = (
106106 self .dbgym_workspace .cur_task_runs_artifacts_path (mkdir = True )
107107 / f"pg{ self .pgport } .log"
108108 )
109- pglog_this_step_fpath = (
109+ pglog_this_step_path = (
110110 self .dbgym_workspace .cur_task_runs_artifacts_path (mkdir = True )
111111 / f"pg{ self .pgport } .log.{ self .log_step } "
112112 )
113- if pglog_fpath .exists ():
114- shutil .move (pglog_fpath , pglog_this_step_fpath )
113+ if pglog_path .exists ():
114+ shutil .move (pglog_path , pglog_this_step_path )
115115 self .log_step += 1
116116
117117 def force_statement_timeout (self , timeout : float ) -> None :
@@ -273,7 +273,7 @@ def restart_with_changes(
273273 "cf" ,
274274 # We append .tmp so that if we fail in the *middle* of running tar, we
275275 # still have the previous checkpoint available to us
276- f"{ self .checkpoint_dbdata_snapshot_fpath } .tmp" ,
276+ f"{ self .checkpoint_dbdata_snapshot_path } .tmp" ,
277277 "-C" ,
278278 parent_dpath_of_path (self .dbdata_dpath ),
279279 self .dbdata_dpath ,
@@ -345,8 +345,8 @@ def restart_with_changes(
345345 )
346346
347347 # Set up Boot if we're told to do so
348- if self .boot_config_fpath is not None :
349- with self .dbgym_workspace .open_and_save (self .boot_config_fpath ) as f :
348+ if self .boot_config_path is not None :
349+ with self .dbgym_workspace .open_and_save (self .boot_config_path ) as f :
350350 boot_config = yaml .safe_load (f )
351351
352352 self ._set_up_boot (
@@ -483,10 +483,10 @@ def get_system_knobs(self) -> dict[str, str]:
483483 return knobs
484484
485485 def restore_pristine_snapshot (self ) -> bool :
486- return self ._restore_snapshot (self .pristine_dbdata_snapshot_fpath )
486+ return self ._restore_snapshot (self .pristine_dbdata_snapshot_path )
487487
488488 def restore_checkpointed_snapshot (self ) -> bool :
489- return self ._restore_snapshot (self .checkpoint_dbdata_snapshot_fpath )
489+ return self ._restore_snapshot (self .checkpoint_dbdata_snapshot_path )
490490
491491 def _restore_snapshot (
492492 self ,
0 commit comments