@Override
  public void map(LongWritable offset, Text value, Context context) throws IOException {
    byte[] lineBytes = value.getBytes();

    try {
      ImportTsv.TsvParser.ParsedLine parsed = parser.parse(lineBytes, value.getLength());
      ImmutableBytesWritable rowKey =
        new ImmutableBytesWritable(lineBytes, parsed.getRowKeyOffset(), parsed.getRowKeyLength());
      // Retrieve timestamp if exists
      ts = parsed.getTimestamp(ts);
      cellVisibilityExpr = parsed.getCellVisibility();
      ttl = parsed.getCellTTL();

      // create tags for the parsed line
      if (hfileOutPath != null) {
        tags.clear();
        if (cellVisibilityExpr != null) {
          tags.addAll(kvCreator.getVisibilityExpressionResolver()
            .createVisibilityExpTags(cellVisibilityExpr));
        }
        // Add TTL directly to the KV so we can vary them when packing more than one KV
        // into puts
        if (ttl > 0) {
          tags.add(new ArrayBackedTag(TagType.TTL_TAG_TYPE, Bytes.toBytes(ttl)));
        }
      }
      Put put = new Put(rowKey.copyBytes());
      for (int i = 0; i < parsed.getColumnCount(); i++) {
        if (
          i == parser.getRowKeyColumnIndex() || i == parser.getTimestampKeyColumnIndex()
            || i == parser.getAttributesKeyColumnIndex()
            || i == parser.getCellVisibilityColumnIndex() || i == parser.getCellTTLColumnIndex()
            || (skipEmptyColumns && parsed.getColumnLength(i) == 0)
        ) {
          continue;
        }
        populatePut(lineBytes, parsed, put, i);
      }
      context.write(rowKey, put);
    } catch (ImportTsv.TsvParser.BadTsvLineException | IllegalArgumentException
      | InvalidLabelException badLine) {
      if (logBadLines) {
        System.err.println(value);
      }
      System.err.println("Bad line at offset: " + offset.get() + ":\n" + badLine.getMessage());
      if (skipBadLines) {
        incrementBadLineCount(1);
        return;
      }
      throw new IOException(badLine);
    } catch (InterruptedException e) {
      LOG.error("Interrupted while emitting put", e);
      Thread.currentThread().interrupt();
    }
  }
Convert a line of TSV text into an HBase table row.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TsvImporterMapper.java