@Override
  protected void putbackBuffer(ByteBuffer buf) {
    if (buf.capacity() != bufSize || (reservoirEnabled ^ buf.isDirect())) {
      LOG.warn("Trying to put a buffer, not created by this pool! Will be just ignored");
      return;
    }
    buf.clear();
    byte[] tmp = generateTmpBytes(buf.capacity());
    buf.put(tmp, 0, tmp.length);
    super.putbackBuffer(buf);
  }
A ByteBuffAllocator that rewrite the bytebuffers right after released. It can be used for test
whether there are prematurely releasing backing bytebuffers.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/DeallocateRewriteByteBuffAllocator.java