@Override
    protected void setup(Context context) throws IOException, InterruptedException {
      Configuration configuration = context.getConfiguration();
      String tableName = configuration.get("index.tablename");
      String[] fields = configuration.getStrings("index.fields");
      String familyName = configuration.get("index.familyname");
      family = Bytes.toBytes(familyName);
      indexes = new TreeMap<>(Bytes.BYTES_COMPARATOR);
      for (String field : fields) {
        // if the table is "people" and the field to index is "email", then the
        // index table will be called "people-email"
        indexes.put(Bytes.toBytes(field),
          new ImmutableBytesWritable(Bytes.toBytes(tableName + "-" + field)));
      }
    }
Internal Mapper to be run by Hadoop.
hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/IndexBuilder.java