Class TrackingByteBufferPool

java.lang.Object
org.apache.hadoop.fs.impl.TrackingByteBufferPool
All Implemented Interfaces:
AutoCloseable, ByteBufferPool

@VisibleForTesting public final class TrackingByteBufferPool extends Object implements ByteBufferPool, AutoCloseable
A wrapper ByteBufferPool implementation that tracks whether all allocated buffers are released.

It throws the related exception at close() if any buffer remains un-released. It also clears the buffers at release so if they continued being used it'll generate errors.

To be used for testing..

The stacktraces of the allocation are not stored by default because it can significantly decrease the unit test performance. Configuring this class to log at DEBUG will trigger their collection.

See Also: