code: public int run(String[] args) throws Exception {
  
      Configuration hbaseConf = HBaseConfiguration.create(getConf());
  
      // Grab input args and allow for -Dxyz style arguments
      String[] otherArgs =
          new GenericOptionsParser(hbaseConf, args).getRemainingArgs();
  
      // Grab the arguments we're looking for.
      CommandLine commandLine = parseArgs(otherArgs);
  
      // Grab the cluster argument
      String cluster = commandLine.getOptionValue("c");
      LOG.info("cluster=" + cluster);
  
      // Grab the cluster argument
  
      String processFileSubstring = null;
      if (commandLine.hasOption("p")) {
        processFileSubstring = commandLine.getOptionValue("p");
      }
      LOG.info("processFileSubstring=" + processFileSubstring);
  
      // Default to no max
      Integer maxCount = Integer.MAX_VALUE;
      if (commandLine.hasOption("m")) {
        try {
          maxCount = Integer.parseInt(commandLine.getOptionValue("m"));
        } catch (NumberFormatException nfe) {
          System.err.println("Error: " + NAME + " maxCount is not an integer: "
              + commandLine.getOptionValue("m"));
        }
      }
  
      boolean success = true;
      Connection hbaseConnection = null;
      try {
        hbaseConnection = ConnectionFactory.createConnection(hbaseConf);
        success = printProcessRecordsFromHBase(hbaseConf, hbaseConnection,
            cluster, maxCount, processFileSubstring);
      } finally {
        if (hbaseConnection == null) {
          success = false;
        } else {
          hbaseConnection.close();
        }
      }
  
      // Return the status
      return success ? 0 : 1;
    }
docs: /*
  (non-Javadoc)
  
  @see org.apache.hadoop.util.Tool#run(java.lang.String[])