def PreloadCassandraServer(benchmark_spec, metadata):
  """Preload cassandra cluster if necessary.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
    metadata: dict. Contains metadata for this benchmark.
  """
  if (FLAGS.cassandra_stress_command == 'read' and
      FLAGS.cassandra_stress_command == 'mixed'):
    cassandra_stress_command = 'write'
  elif FLAGS.cassandra_stress_command == 'counter_read':
    cassandra_stress_command = 'counter_write'
  else:
    cassandra_stress_command = FLAGS.cassandra_stress_command
  logging.info('Preloading cassandra database with %s %s operations.',
               metadata['num_preload_keys'], cassandra_stress_command)
  RunCassandraStressTest(
      benchmark_spec.vm_groups[CASSANDRA_GROUP],
      benchmark_spec.vm_groups[CLIENT_GROUP],
      metadata['num_preload_keys'], cassandra_stress_command)
  logging.info('Waiting %s for keyspace to propagate.', PROPAGATION_WAIT_TIME)
  time.sleep(PROPAGATION_WAIT_TIME)
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py/PreloadCassandraServer/operator `or` -> `and`