static int getBufferSize(long capacity) {
    int bufferSize = DEFAULT_BUFFER_SIZE;
    if (bufferSize > (capacity / 16)) {
      bufferSize = (int) roundUp(capacity / 16, 32768);
    }
    return bufferSize;
  }
We allocate a number of byte buffers as the capacity.
@param capacity  total size of the byte buffer array
@param allocator the ByteBufferAllocator that will create the buffers
@throws IOException throws IOException if there is an exception thrown by the allocator
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java