private static void mergeSerializations(Configuration conf) {
    List<String> serializations = new ArrayList<>();

    // add any existing values that have been set
    String[] existing = conf.getStrings("io.serializations");
    if (existing != null) {
      Collections.addAll(serializations, existing);
    }

    serializations.add(MutationSerialization.class.getName());
    serializations.add(ResultSerialization.class.getName());

    // Add ExtendedCellSerialization, if configured. Order matters here. Hadoop's
    // SerializationFactory runs through serializations in the order they are registered.
    // We want to register ExtendedCellSerialization before CellSerialization because both
    // work for ExtendedCells but only ExtendedCellSerialization handles them properly.
    if (
      conf.getBoolean(EXTENDED_CELL_SERIALIZATION_ENABLED_KEY,
        EXTENDED_CELL_SERIALIZATION_ENABLED_DEFULT)
    ) {
      serializations.add(ExtendedCellSerialization.class.getName());
    }
    serializations.add(CellSerialization.class.getName());

    conf.setStrings("io.serializations", serializations.toArray(new String[0]));
  }
Configure a MapReduce Job to perform an incremental load into the given table. This
<ul>
<li>Inspects the table to configure a total order partitioner</li>
<li>Uploads the partitions file to the cluster and adds it to the DistributedCache</li>
<li>Sets the number of reduce tasks to match the current number of regions</li>
<li>Sets the output key/value class to match HFileOutputFormat2's requirements</li>
<li>Sets the reducer up to perform the appropriate sorting (either KeyValueSortReducer or
PutSortReducer)</li>
</ul>
The user should be sure to set the map output value class to either KeyValue or Put before
running this function.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java