@Override
    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "NP_NULL_ON_SOME_PATH",
        justification = "Findbugs is blind to the Precondition null check")
    public void map(ImmutableBytesWritable row, Result values, Context context) throws IOException {
      Preconditions.checkState(values != null, "values passed to the map is null");

      try {
        byte[] currentRow = values.getRow();
        if (lastRow == null || !Bytes.equals(lastRow, currentRow)) {
          lastRow = currentRow;
          currentRowKey = Bytes.toStringBinary(currentRow);
          currentFamily = null;
          currentQualifier = null;
          context.getCounter(Counters.ROWS).increment(1);
          context.write(new Text("Total ROWS"), new LongWritable(1));
        }
        if (!values.isEmpty()) {
          int cellCount = 0;
          for (Cell value : values.listCells()) {
            cellCount++;
            long size = value.getSerializedSize();
            if (currentFamily == null || !CellUtil.matchingFamily(value, currentFamily)) {
              currentFamily = CellUtil.cloneFamily(value);
              currentFamilyName = Bytes.toStringBinary(currentFamily);
              currentQualifier = null;
              context.getCounter("CF", currentFamilyName).increment(1);
              if (1 == context.getCounter("CF", currentFamilyName).getValue()) {
                context.write(new Text("Total Families Across all Rows"), new LongWritable(1));
                context.write(new Text(currentFamily), new LongWritable(1));
              }
              context.getCounter(Counters.SIZE).increment(size);
              context.write(new Text("Total SIZE"), new LongWritable(size));
              context.getCounter("CF", currentFamilyName + "_Size").increment(size);
              context.write(new Text(currentFamilyName + "_Size"), new LongWritable(size));
            }
            if (currentQualifier == null || !CellUtil.matchingQualifier(value, currentQualifier)) {
              currentQualifier = CellUtil.cloneQualifier(value);
              currentQualifierName =
                currentFamilyName + separator + Bytes.toStringBinary(currentQualifier);
              currentRowQualifierName = currentRowKey + separator + currentQualifierName;

              context.write(new Text("Total Qualifiers across all Rows"), new LongWritable(1));
              context.write(new Text(currentQualifierName), new LongWritable(1));
              context.getCounter("Q", currentQualifierName + "_Size").increment(size);
              context.write(new Text(currentQualifierName + "_Size"), new LongWritable(size));
            }
            // Increment versions
            context.write(new Text(currentRowQualifierName + "_Versions"), new LongWritable(1));
          }
          context.getCounter(Counters.CELLS).increment(cellCount);
        }
      } catch (InterruptedException e) {
        LOG.error("Interrupted while writing cellCount", e);
        Thread.currentThread().interrupt();
      }
    }
Maps the data.
@param row     The current table row key.
@param values  The columns.
@param context The current context.
@throws IOException When something is broken with the data.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java