Skip to content

Commit

Permalink
Add flagholder for --ycsb_skip_load_stage.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 563836537
  • Loading branch information
bvliu authored and copybara-github committed Sep 8, 2023
1 parent 7063987 commit 0587057
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions perfkitbenchmarker/linux_packages/ycsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
flags.DEFINE_boolean(
'ycsb_load_samples', True, 'Include samples from pre-populating database.'
)
flags.DEFINE_boolean(
SKIP_LOAD_STAGE = flags.DEFINE_boolean(
'ycsb_skip_load_stage',
False,
'If True, skip the data '
Expand Down Expand Up @@ -1013,7 +1013,7 @@ def _DoRunStairCaseLoad(

def Load(self, vms, workloads=None, load_kwargs=None):
"""Load data using YCSB."""
if FLAGS.ycsb_skip_load_stage:
if SKIP_LOAD_STAGE.value:
return []

workloads = workloads or GetWorkloadFileList()
Expand Down Expand Up @@ -1065,7 +1065,7 @@ def Run(self, vms, workloads=None, run_kwargs=None) -> list[sample.Sample]:
samples = list(self.RunStaircaseLoads(vms, workloads, **run_kwargs))
if (
FLAGS.ycsb_sleep_after_load_in_sec > 0
and not FLAGS.ycsb_skip_load_stage
and not SKIP_LOAD_STAGE.value
):
for s in samples:
s.metadata['sleep_after_load_in_sec'] = (
Expand Down Expand Up @@ -1187,7 +1187,7 @@ def LoadAndRun(self, vms, workloads=None, load_kwargs=None, run_kwargs=None):
List of sample.Sample objects.
"""
load_samples = []
if not FLAGS.ycsb_skip_load_stage:
if not SKIP_LOAD_STAGE.value:
load_samples = self.Load(
vms, workloads=workloads, load_kwargs=load_kwargs
)
Expand Down

0 comments on commit 0587057

Please sign in to comment.