private void preRunMsck(boolean isMsck) {
    if (isMsck) {
      matches = new Pattern[]{Pattern.compile("PartitionManagementTask.*")};
    } else {
      List<Pattern> excludes = new ArrayList<>();
      Optional.ofNullable(exclude)
          .ifPresent(patterns -> Arrays.stream(patterns).forEach(p -> excludes.add(p)));
      excludes.add(Pattern.compile("PartitionManagementTask.*"));
      exclude = excludes.toArray(new Pattern[0]);
    }
  }
Command-line access to Hive Metastore.
standalone-metastore/metastore-tools/metastore-benchmarks/src/main/java/org/apache/hadoop/hive/metastore/tools/BenchmarkTool.java