code: public int run(String[] args) throws ParseException, IOException,
        ClassNotFoundException, InterruptedException {
  
      Configuration hbaseConf = HBaseConfiguration.create(getConf());
      hdfs = FileSystem.get(hbaseConf);
  
      // 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);
  
      String input = null;
      boolean inputSpecified = commandLine.hasOption("i");
      if (inputSpecified) {
        // Grab the input path argument
        input = commandLine.getOptionValue("i");
        LOG.info("input=" + input);
      } else {
        LOG.info("Processing input from HBase ProcessRecords");
      }
  
      // Grab the cluster argument
      String cluster = commandLine.getOptionValue("c");
      LOG.info("cluster=" + cluster);
  
      String processFileSubstring = null;
      if (commandLine.hasOption("p")) {
        processFileSubstring = commandLine.getOptionValue("p");
      }
      LOG.info("processFileSubstring=" + processFileSubstring);
  
      boolean forceReprocess = commandLine.hasOption("f");
      LOG.info("forceReprocess: " + forceReprocess);
  
      // hbase.client.keyvalue.maxsize somehow defaults to 10 MB and we have
      // history files exceeding that. Disable limit.
      hbaseConf.setInt("hbase.client.keyvalue.maxsize", 0);
  
      // Shove this into the jobConf so that we can get it out on the task side.
      hbaseConf.setStrings(Constants.CLUSTER_JOB_CONF_KEY, cluster);
  
      boolean success = true;
      Connection hbaseConnection = null;
      try {
        hbaseConnection = ConnectionFactory.createConnection(hbaseConf);
        success = processRecordsFromHBase(hbaseConf, hbaseConnection, cluster,
            processFileSubstring, forceReprocess);
      } 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[])