@Override
  public void map(LongWritable offset, Text value, Context context) throws IOException {
    byte[] family = Bytes.toBytes("FAM");
    final byte[][] qualifiers = { Bytes.toBytes("A"), Bytes.toBytes("B") };

    // do some basic line parsing
    byte[] lineBytes = value.getBytes();
    String[] valueTokens = new String(lineBytes, StandardCharsets.UTF_8).split("\u001b");

    // create the rowKey and Put
    ImmutableBytesWritable rowKey = new ImmutableBytesWritable(Bytes.toBytes(valueTokens[0]));
    Put put = new Put(rowKey.copyBytes());
    put.setDurability(Durability.SKIP_WAL);

    // The value should look like this: VALUE1 or VALUE2. Let's multiply
    // the integer by 3
    for (int i = 1; i < valueTokens.length; i++) {
      String prefix = valueTokens[i].substring(0, "VALUE".length());
      String suffix = valueTokens[i].substring("VALUE".length());
      String newValue = prefix + Integer.parseInt(suffix) * 3;

      KeyValue kv =
        new KeyValue(rowKey.copyBytes(), family, qualifiers[i - 1], Bytes.toBytes(newValue));
      put.add(kv);
    }

    try {
      context.write(rowKey, put);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
Convert a line of TSV text into an HBase table row after transforming the values by multiplying
them by 3.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapper.java