private void runNonAcidBenchmarks() {
    StringBuilder sb = new StringBuilder();
    BenchData bData = new BenchData(dbName, tableName);

    MicroBenchmark bench = new MicroBenchmark(warmup, spinCount);
    BenchmarkSuite suite = new BenchmarkSuite();

    suite
        .setScale(scale)
        .doSanitize(doSanitize)
        .add("getNid", () -> benchmarkGetNotificationId(bench, bData))
        .add("listDatabases", () -> benchmarkListDatabases(bench, bData))
        .add("listTables", () -> benchmarkListAllTables(bench, bData))
        .add("getTable", () -> benchmarkGetTable(bench, bData))
        .add("createTable", () -> benchmarkTableCreate(bench, bData))
        .add("dropTable", () -> benchmarkDeleteCreate(bench, bData))
        .add("dropTableWithPartitions",
            () -> benchmarkDeleteWithPartitions(bench, bData, 1, nParameters[0]))
        .add("dropTableMetadataWithPartitions",
            () -> benchmarkDeleteMetaOnlyWithPartitions(bench, bData, 1, nParameters[0]))
        .add("addPartition", () -> benchmarkCreatePartition(bench, bData, 1))
        .add("dropPartition", () -> benchmarkDropPartition(bench, bData, 1))
        .add("listPartition", () -> benchmarkListPartition(bench, bData))
        .add("getPartition",
            () -> benchmarkGetPartitions(bench, bData, 1))
        .add("getPartitionNames",
            () -> benchmarkGetPartitionNames(bench, bData, 1))
        .add("getPartitionsByNames",
            () -> benchmarkGetPartitionsByName(bench, bData, 1))
        .add("getPartitionsByFilter",
            () -> benchmarkGetPartitionsByFilter(bench, bData, 1))
        .add("getPartitionsByPs",
            () -> benchmarkGetPartitionsByPs(bench, bData, 1))
        .add("getPartitionsStat",
            () -> benchmarkGetPartitionsStat(bench, bData, 1))
        .add("updatePartitionsStat",
            () -> benchmarkUpdatePartitionsStat(bench, bData, 1))
        .add("renameTable",
            () -> benchmarkRenameTable(bench, bData, 1))
        .add("dropDatabase",
            () -> benchmarkDropDatabase(bench, bData, 1))
        .add("openTxn",
            () -> benchmarkOpenTxns(bench, bData, 1))
        .add("PartitionManagementTask",
            () -> benchmarkPartitionManagement(bench, bData, 1));

    for (int howMany: instances) {
      suite.add("listTables" + '.' + howMany,
          () -> benchmarkListTables(bench, bData, howMany))
          .add("dropTableWithPartitions" + '.' + howMany,
              () -> benchmarkDeleteWithPartitions(bench, bData, howMany, nParameters[0]))
          .add("dropTableMetaOnlyWithPartitions" + '.' + howMany,
              () -> benchmarkDeleteMetaOnlyWithPartitions(bench, bData, howMany, nParameters[0]))
          .add("listPartitions" + '.' + howMany,
              () -> benchmarkListManyPartitions(bench, bData, howMany))
          .add("getPartitions" + '.' + howMany,
              () -> benchmarkGetPartitions(bench, bData, howMany))
          .add("getPartitionNames" + '.' + howMany,
              () -> benchmarkGetPartitionNames(bench, bData, howMany))
          .add("getPartitionsByNames" + '.' + howMany,
              () -> benchmarkGetPartitionsByName(bench, bData, howMany))
          .add("getPartitionsByFilter" + '.' + howMany,
              () -> benchmarkGetPartitionsByFilter(bench, bData, howMany))
          .add("getPartitionsByPs" + '.' + howMany,
              () -> benchmarkGetPartitionsByPs(bench, bData, howMany))
          .add("getPartitionsStat" + '.' + howMany,
              () -> benchmarkGetPartitionsStat(bench, bData, howMany))
          .add("updatePartitionsStat" + '.' + howMany,
              () -> benchmarkUpdatePartitionsStat(bench, bData, howMany))
          .add("addPartitions" + '.' + howMany,
              () -> benchmarkCreatePartitions(bench, bData, howMany))
          .add("dropPartitions" + '.' + howMany,
              () -> benchmarkDropPartitions(bench, bData, howMany))
          .add("alterPartitions" + '.' + howMany,
              () -> benchmarkAlterPartitions(bench, bData, howMany))
          .add("renameTable" + '.' + howMany,
              () -> benchmarkRenameTable(bench, bData, howMany))
          .add("dropDatabase" + '.' + howMany,
              () -> benchmarkDropDatabase(bench, bData, howMany))
          .add("addPartition" + '.' + howMany,
              () -> benchmarkCreatePartition(bench, bData, howMany))
          .add("dropPartition" + '.' + howMany,
              () -> benchmarkDropPartition(bench, bData, howMany))
          .add("openTxns" + '.' + howMany,
              () -> benchmarkOpenTxns(bench, bData, howMany))
          .add("PartitionManagementTask" + "." + howMany,
              () -> benchmarkPartitionManagement(bench, bData, howMany));
    }

    List<String> toRun = suite.listMatching(matches, exclude);
    if (toRun.isEmpty()) {
      return;
    }
    if (doList) {
      toRun.forEach(System.out::println);
      return;
    }

    LOG.info("Using table '{}.{}", dbName, tableName);

    try (HMSClient client = new HMSClient(getServerUri(host, String.valueOf(port)), confDir)) {
      bData.setClient(client);
      if (!client.dbExists(dbName)) {
        client.createDatabase(dbName);
      }

      if (client.tableExists(dbName, tableName)) {
        client.dropTable(dbName, tableName);
      }

      // Arrange various benchmarks in a suite
      BenchmarkSuite result = suite.runMatching(matches, exclude);

      Formatter fmt = new Formatter(sb);
      if (doCSV) {
        result.displayCSV(fmt, csvSeparator);
      } else {
        result.display(fmt);
      }

      PrintStream output = System.out;
      if (outputFile != null) {
        output = new PrintStream(outputFile);
      }

      if (outputFile != null) {
        // Print results to stdout as well
        StringBuilder s = new StringBuilder();
        Formatter f = new Formatter(s);
        result.display(f);
        System.out.print(s);
        f.close();
      }

      output.print(sb.toString());
      fmt.close();
      output.close();

      if (dataSaveDir != null) {
        saveData(result.getResult(), dataSaveDir, scale);
      }
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
    }
  }
Command-line access to Hive Metastore.
standalone-metastore/metastore-tools/metastore-benchmarks/src/main/java/org/apache/hadoop/hive/metastore/tools/BenchmarkTool.java