def Prepare(benchmark_spec):
    benchmark_spec.always_call_cleanup = True
    ycsb.SetYcsbTarUrl(YCSB_BINDING_TAR_URL)
    vms = benchmark_spec.vms

    # Install required packages and copy credential files
    vm_util.RunThreaded(_Install, vms)

    # Restore YCSB_TAR_URL
    ycsb.SetYcsbTarUrl(None)
    benchmark_spec.executor = ycsb.YCSBExecutor('googlefirestore')
示例#2
0
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec) -> None:
  """Prepare the virtual machines to run cloud bigtable.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
  benchmark_spec.always_call_cleanup = True
  vms = benchmark_spec.vms
  if _TABLE_OBJECT_SHARING.value:
    ycsb.SetYcsbTarUrl(YCSB_BIGTABLE_TABLE_SHARING_TAR_URL)

  instance: _Bigtable = benchmark_spec.non_relational_db
  args = [((vm, instance), {}) for vm in vms]
  vm_util.RunThreaded(_Install, args)

  table_name = _GetTableName()
  # If the table already exists, it will be an no-op.
  hbase_ycsb.CreateYCSBTable(vms[0], table_name=table_name, use_snappy=False,
                             limit_filesize=False)

  # Add hbase conf dir to the classpath.
  ycsb_memory = min(vms[0].total_memory_kb // 1024, 4096)
  jvm_args = pipes.quote(f' -Xmx{ycsb_memory}m')

  executor_flags = {
      'cp': hbase.HBASE_CONF_DIR,
      'jvm-args': jvm_args,
      'table': table_name}

  benchmark_spec.executor = ycsb.YCSBExecutor(FLAGS.hbase_binding,
                                              **executor_flags)
def Prepare(benchmark_spec):
    """Prepare the virtual machines to run cloud spanner benchmarks.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
    benchmark_spec.always_call_cleanup = True

    benchmark_spec.spanner_instance = gcp_spanner.GcpSpannerInstance(
        name=BENCHMARK_INSTANCE_PREFIX + FLAGS.run_uri,
        description=BENCHMARK_DESCRIPTION,
        database=BENCHMARK_DATABASE,
        ddl=BENCHMARK_SCHEMA)
    if benchmark_spec.spanner_instance._Exists(instance_only=True):
        logging.warning('Cloud Spanner instance %s exists, delete it first.' %
                        FLAGS.cloud_spanner_ycsb_instance)
        benchmark_spec.spanner_instance.Delete()
    benchmark_spec.spanner_instance.Create()
    if not benchmark_spec.spanner_instance._Exists():
        logging.warning(
            'Failed to create Cloud Spanner instance and database.')
        benchmark_spec.spanner_instance.Delete()

    if FLAGS.cloud_spanner_ycsb_client_type != 'java':
        ycsb.SetYcsbTarUrl(
            CLIENT_TAR_URL[FLAGS.cloud_spanner_ycsb_client_type])

    vms = benchmark_spec.vms

    # Install required packages and copy credential files
    vm_util.RunThreaded(_Install, vms)

    benchmark_spec.executor = ycsb.YCSBExecutor('cloudspanner')
def Prepare(benchmark_spec):
    """Prepare the virtual machines to run cloud spanner benchmarks.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """

    benchmark_spec.always_call_cleanup = True if not FLAGS.cloud_spanner_instance_name else False

    instance_name = FLAGS.cloud_spanner_instance_name or BENCHMARK_INSTANCE_PREFIX + FLAGS.run_uri
    instance_description = FLAGS.cloud_spanner_instance_description or BENCHMARK_DESCRIPTION
    benchmark_spec.spanner_instance = gcp_spanner.GcpSpannerInstance(
        name=instance_name,
        description=instance_description,
        database=BENCHMARK_DATABASE,
        ddl=BENCHMARK_SCHEMA)

    # If instance name is provided, we might re-use an existing instance
    if FLAGS.cloud_spanner_instance_name:
        benchmark_spec.always_call_cleanup = False
        if benchmark_spec.spanner_instance._Exists(instance_only=True):
            logging.info("Re-using existing instance %s", instance_name)
        else:
            logging.info("Creating new instance %s", instance_name)
            benchmark_spec.spanner_instance.Create()

    # If instance name is not provided, we delete the existing instance before creating
    elif benchmark_spec.spanner_instance._Exists(instance_only=True):
        logging.warning('Cloud Spanner instance %s exists, delete it first.' %
                        instance_name)
        benchmark_spec.spanner_instance.Delete()
        logging.info("Creating new instance %s", instance_name)
        benchmark_spec.spanner_instance.Create()

    if not benchmark_spec.spanner_instance._Exists():
        logging.warning(
            'Failed to create Cloud Spanner instance and database.')
        benchmark_spec.spanner_instance.Delete()

    if FLAGS.cloud_spanner_ycsb_client_type != 'java':
        ycsb.SetYcsbTarUrl(
            CLIENT_TAR_URL[FLAGS.cloud_spanner_ycsb_client_type])

    vms = benchmark_spec.vms

    # Install required packages and copy credential files
    vm_util.RunThreaded(_Install, vms)

    benchmark_spec.executor = ycsb.YCSBExecutor('cloudspanner')
示例#5
0
def Prepare(benchmark_spec):
    """Prepare the virtual machines to run cloud bigtable.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
    benchmark_spec.always_call_cleanup = True
    vms = benchmark_spec.vms
    if FLAGS.google_bigtable_enable_table_object_sharing:
        ycsb.SetYcsbTarUrl(YCSB_BIGTABLE_TABLE_SHARING_TAR_URL)

    # TODO: in the future, it might be nice to change this so that
    # a gcp_bigtable.GcpBigtableInstance can be created with an
    # flag that says don't create/delete the instance.  That would
    # reduce the code paths here.
    if FLAGS.google_bigtable_instance_name is None:
        instance_name = 'pkb-bigtable-{0}'.format(FLAGS.run_uri)
        project = FLAGS.project or _GetDefaultProject()
        logging.info('Creating bigtable instance %s', instance_name)
        zone = FLAGS.google_bigtable_zone
        benchmark_spec.bigtable_instance = gcp_bigtable.GcpBigtableInstance(
            instance_name, project, zone)
        benchmark_spec.bigtable_instance.Create()
        instance = _GetInstanceDescription(project, instance_name)
        logging.info('Instance %s created successfully', instance)

    vm_util.RunThreaded(_Install, vms)

    table_name = _GetTableName()
    # If the table already exists, it will be an no-op.
    hbase_ycsb.CreateYCSBTable(vms[0],
                               table_name=table_name,
                               use_snappy=False,
                               limit_filesize=False)

    # Add hbase conf dir to the classpath.
    ycsb_memory = min(vms[0].total_memory_kb // 1024, 4096)
    jvm_args = pipes.quote(' -Xmx{0}m'.format(ycsb_memory))

    executor_flags = {
        'cp': hbase.HBASE_CONF_DIR,
        'jvm-args': jvm_args,
        'table': table_name
    }

    benchmark_spec.executor = ycsb.YCSBExecutor('hbase10', **executor_flags)
示例#6
0
def Prepare(benchmark_spec):
    """Prepare the virtual machines to run cloud spanner benchmarks.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
    benchmark_spec.always_call_cleanup = True

    if FLAGS.cloud_spanner_ycsb_client_type != 'java':
        ycsb.SetYcsbTarUrl(
            CLIENT_TAR_URL[FLAGS.cloud_spanner_ycsb_client_type])

    vms = benchmark_spec.vms

    # Install required packages and copy credential files
    vm_util.RunThreaded(_Install, vms)

    benchmark_spec.executor = ycsb.YCSBExecutor('cloudspanner')