@Override
    public void setup(Context context) throws IOException {
      cfRenameMap = createCfRenameMap(context.getConfiguration());
      filter = instantiateFilter(context.getConfiguration());
      int reduceNum = context.getNumReduceTasks();
      Configuration conf = context.getConfiguration();
      TableName tableName = TableName.valueOf(context.getConfiguration().get(TABLE_NAME));
      try (Connection conn = ConnectionFactory.createConnection(conf);
        RegionLocator regionLocator = conn.getRegionLocator(tableName)) {
        byte[][] startKeys = regionLocator.getStartKeys();
        if (startKeys.length != reduceNum) {
          throw new IOException("Region split after job initialization");
        }
        CellWritableComparable[] startKeyWraps = new CellWritableComparable[startKeys.length - 1];
        for (int i = 1; i < startKeys.length; ++i) {
          startKeyWraps[i - 1] =
            new CellWritableComparable(KeyValueUtil.createFirstOnRow(startKeys[i]));
        }
        CellWritableComparablePartitioner.START_KEYS = startKeyWraps;
      }
    }
@param row     The current table row key.
@param value   The columns.
@param context The current context.
@throws IOException When something is broken with the data.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java