protected static Put map(ImmutableBytesWritable key, Result value) throws IOException {
    if (value.size() != 1) {
      throw new IOException("There should only be one input column");
    }
    Map<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> cf = value.getMap();
    if (!cf.containsKey(INPUT_FAMILY)) {
      throw new IOException(
        "Wrong input columns. Missing: '" + Bytes.toString(INPUT_FAMILY) + "'.");
    }

    // Get the original value and reverse it

    String originalValue = Bytes.toString(value.getValue(INPUT_FAMILY, INPUT_FAMILY));
    StringBuilder newValue = new StringBuilder(originalValue);
    newValue.reverse();

    // Now set the value to be collected

    Put outval = new Put(key.get());
    outval.addColumn(OUTPUT_FAMILY, null, Bytes.toBytes(newValue.toString()));
    return outval;
  }
Implements mapper logic for use across APIs.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java