private long getUniqueTimestamp(byte[] row) {
    int slot = Bytes.hashCode(row) & mask;
    MutableLong lastTimestamp = lastTimestamps[slot];
    long now = EnvironmentEdgeManager.currentTime();
    synchronized (lastTimestamp) {
      long pt = lastTimestamp.longValue() >> 10;
      if (now > pt) {
        lastTimestamp.setValue(now << 10);
      } else {
        lastTimestamp.increment();
      }
      return lastTimestamp.longValue();
    }
  }
An example for implementing a counter that reads is much less than writes, i.e, write heavy.
<p>
We will convert increment to put, and do aggregating when get. And of course the return value of
increment is useless then.
<p>
Notice that this is only an example so we do not handle most corner cases, for example, you must
provide a qualifier when doing a get.
hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserver.java