@Override
    protected void map(ImmutableBytesWritable rowKey, Result result, Context context)
      throws IOException, InterruptedException {
      for (java.util.Map.Entry<byte[], ImmutableBytesWritable> index : indexes.entrySet()) {
        byte[] qualifier = index.getKey();
        ImmutableBytesWritable tableName = index.getValue();
        byte[] value = result.getValue(family, qualifier);
        if (value != null) {
          // original: row 123 attribute:phone 555-1212
          // index: row 555-1212 INDEX:ROW 123
          Put put = new Put(value);
          put.addColumn(INDEX_COLUMN, INDEX_QUALIFIER, rowKey.get());
          context.write(tableName, put);
        }
      }
    }
Internal Mapper to be run by Hadoop.
hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/IndexBuilder.java