@Override
  public int run(String[] args) throws Exception {
    if (args.length < 2) {
      usage("Wrong number of arguments: " + args.length);
      return -1;
    }
    String inputVersionString = System.getProperty(ResultSerialization.IMPORT_FORMAT_VER);
    if (inputVersionString != null) {
      getConf().set(ResultSerialization.IMPORT_FORMAT_VER, inputVersionString);
    }
    Job job = createSubmittableJob(getConf(), args);
    boolean isJobSuccessful = job.waitForCompletion(true);
    if (isJobSuccessful) {
      // Flush all the regions of the table
      flushRegionsIfNecessary(getConf());
    }
    long inputRecords = job.getCounters().findCounter(TaskCounter.MAP_INPUT_RECORDS).getValue();
    long outputRecords = job.getCounters().findCounter(TaskCounter.MAP_OUTPUT_RECORDS).getValue();
    if (outputRecords < inputRecords) {
      System.err.println("Warning, not all records were imported (maybe filtered out).");
      if (outputRecords == 0) {
        System.err.println("If the data was exported from HBase 0.94 "
          + "consider using -Dhbase.import.version=0.94.");
      }
    }

    return (isJobSuccessful ? 0 : 1);
  }
If the durability is set to {@link Durability#SKIP_WAL} and the data is imported to hbase, we
need to flush all the regions of the table as the data is held in memory and is also not
present in the Write Ahead Log to replay in scenarios of a crash. This method flushes all the
regions of the table in the scenarios of import data to hbase with {@link Durability#SKIP_WAL}
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java