def Prepare(benchmark_spec):
  vm_dict = benchmark_spec.vm_groups
  cassandra_vms = vm_dict[CASSANDRA_GROUP]
  client_vms = vm_dict[CLIENT_GROUP]
  logging.info('VM dictionary %s', vm_dict)

  logging.info('Authorizing loader[0] permission to access all other vms.')
  client_vms[0].AuthenticateVm()

  logging.info('Preparing data files and Java on all vms.')
  vm_util.RunThreaded(lambda vm: vm.Install('cassandra'), cassandra_vms)
  vm_util.RunThreaded(lambda vm: vm.Install('cassandra_stress'), client_vms)
  seed_vm = cassandra_vms[0]
  configure = functools.partial(cassandra.Configure, seed_vms=[seed_vm])
  vm_util.RunThreaded(configure, cassandra_vms)

  cassandra.StartCluster(seed_vm, cassandra_vms[1:])

  if FLAGS.cassandra_stress_command == USER_COMMAND:
    for vm in client_vms:
      vm.PushFile(FLAGS.cassandra_stress_profile,
                  TEMP_PROFILE_PATH)
  metadata = GenerateMetadataFromFlags(benchmark_spec)
  if metadata['num_preload_keys']:
    CheckMetadata(metadata)
  PreloadCassandraServer(benchmark_spec, metadata)
Install Cassandra and Java on target vms.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py/Prepare