@Override
  public int run(String[] args) throws Exception {
    // Process command-line args. TODO: Better cmd-line processing
    // (but hopefully something not as painful as cli options).
    int errCode = -1;
    if (args.length < 1) {
      printUsage();
      return errCode;
    }

    try {
      for (int i = 0; i < args.length; i++) {
        String cmd = args[i];
        if (cmd.equals("-h") || cmd.startsWith("--h")) {
          printUsage();
          errCode = 0;
          break;
        }

        final String nmr = "--nomapred";
        if (cmd.startsWith(nmr)) {
          nomapred = true;
          continue;
        }

        final String rows = "--rows=";
        if (cmd.startsWith(rows)) {
          R = Integer.parseInt(cmd.substring(rows.length()));
          continue;
        }

        final String table = "--table=";
        if (cmd.startsWith(table)) {
          this.tableName = TableName.valueOf(cmd.substring(table.length()));
          continue;
        }

        final String compress = "--compress=";
        if (cmd.startsWith(compress)) {
          this.compression = Compression.Algorithm.valueOf(cmd.substring(compress.length()));
          continue;
        }

        final String blockEncoding = "--blockEncoding=";
        if (cmd.startsWith(blockEncoding)) {
          this.blockEncoding = DataBlockEncoding.valueOf(cmd.substring(blockEncoding.length()));
          continue;
        }

        final String flushCommits = "--flushCommits=";
        if (cmd.startsWith(flushCommits)) {
          this.flushCommits = Boolean.parseBoolean(cmd.substring(flushCommits.length()));
          continue;
        }

        final String writeToWAL = "--writeToWAL=";
        if (cmd.startsWith(writeToWAL)) {
          this.writeToWAL = Boolean.parseBoolean(cmd.substring(writeToWAL.length()));
          continue;
        }

        final String presplit = "--presplit=";
        if (cmd.startsWith(presplit)) {
          this.presplitRegions = Integer.parseInt(cmd.substring(presplit.length()));
          continue;
        }

        final String inMemory = "--inmemory=";
        if (cmd.startsWith(inMemory)) {
          this.inMemoryCF = Boolean.parseBoolean(cmd.substring(inMemory.length()));
          continue;
        }

        this.connection = ConnectionFactory.createConnection(getConf());

        final String useTags = "--usetags=";
        if (cmd.startsWith(useTags)) {
          this.useTags = Boolean.parseBoolean(cmd.substring(useTags.length()));
          continue;
        }

        final String noOfTags = "--nooftags=";
        if (cmd.startsWith(noOfTags)) {
          this.noOfTags = Integer.parseInt(cmd.substring(noOfTags.length()));
          continue;
        }

        final String host = "--host=";
        if (cmd.startsWith(host)) {
          cluster.add(cmd.substring(host.length()));
          continue;
        }

        Class<? extends Test> cmdClass = determineCommandClass(cmd);
        if (cmdClass != null) {
          getArgs(i + 1, args);
          if (cluster.isEmpty()) {
            String s = conf.get("stargate.hostname", "localhost");
            if (s.contains(":")) {
              cluster.add(s);
            } else {
              cluster.add(s, conf.getInt("stargate.port", 8080));
            }
          }
          runTest(cmdClass);
          errCode = 0;
          break;
        }

        printUsage();
        break;
      }
    } catch (Exception e) {
      LOG.error("Failed", e);
    }

    return errCode;
  }
Format passed integer.
@param number the integer to format
@return Returns zero-prefixed 10-byte wide decimal version of passed number (Does absolute in
        case number is negative).
hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java