private void releaseBuffer(ByteBuffer bb, boolean isFromDataReader) {
    if (isTracingEnabled) {
      LOG.trace("Releasing the buffer " + System.identityHashCode(bb));
    }
    if (isFromDataReader && dataReader.isTrackingDiskRanges()) {
      dataReader.releaseBuffer(bb);
      return;
    }
    if (!bb.isDirect() || !CleanerUtil.UNMAP_SUPPORTED) {
      return;
    }
    try {
      CleanerUtil.getCleaner().freeBuffer(bb);
    } catch (Exception e) {
      // leave it for GC to clean up
      LOG.warn("Unable to clean direct buffers using Cleaner");
    }
  }
Reads one compression block from the source; handles compression blocks read from
multiple ranges (usually, that would only happen with zcr).
Adds stuff to cachedBuffers, toDecompress and toRelease (see below what each does).
@param current BufferChunk where compression block starts.
@param cacheBuffers The result buffer array to add pre-allocated target cache buffer.
@param toDecompress The list of work to decompress - pairs of compressed buffers and the
                    target buffers (same as the ones added to cacheBuffers).
@param toRelease The list of buffers to release to zcr because they are no longer in use.
@param badEstimates The list of bad estimates that cannot be decompressed.
@return The resulting cache chunk.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java