@Override
      protected void map(BytesWritable key, NullWritable value, Context output) throws IOException {
        current[i] = new byte[key.getLength()];
        System.arraycopy(key.getBytes(), 0, current[i], 0, key.getLength());
        if (++i == current.length) {
          LOG.debug("Persisting current.length={}, count={}, id={}, current={}, i=", current.length,
            count, Bytes.toStringBinary(id), Bytes.toStringBinary(current[0]), i);
          persist(output, count, prev, current, id);
          i = 0;

          if (first == null) {
            first = current;
          }
          prev = current;
          current = new byte[this.width][];

          count += current.length;
          output.setStatus("Count " + count);

          if (count % wrap == 0) {
            // this block of code turns the 1 million linked list of length 25 into one giant
            // circular linked list of 25 million
            circularLeftShift(first);
            persist(output, -1, prev, first, null);
            // At this point the entire loop has been flushed so we can add one of its nodes to the
            // concurrent walker
            if (numWalkers > 0) {
              addFlushed(key.getBytes());
              if (walkers.isEmpty()) {
                startWalkers(numWalkers, conf, output);
              }
            }
            first = null;
            prev = null;
          }
        }
      }
Some ASCII art time:
<p>
[ . . . ] represents one batch of random longs of length WIDTH

<pre>
               _________________________
              |                  ______ |
              |                 |      ||
            .-+-----------------+-----.||
            | |                 |     |||
first   = [ . . . . . . . . . . . ]   |||
            ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^     |||
            | | | | | | | | | | |     |||
prev    = [ . . . . . . . . . . . ]   |||
            ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^     |||
            | | | | | | | | | | |     |||
current = [ . . . . . . . . . . . ]   |||
                                      |||
...                                   |||
                                      |||
last    = [ . . . . . . . . . . . ]   |||
            ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^_____|||
            |                 |________||
            |___________________________|
</pre>
hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java