Interface IBufferPool
- All Superinterfaces:
IBufferProvider
- All Known Subinterfaces:
IBufferPool.Introspection
A buffer provider that reuses retained buffers and can evict pooled storage.
Eviction removes a buffer from the pool and passes it to the underlying provider for retention, which may dispose of it. A buffer currently checked out by a client is not part of the pool and is not eligible for eviction.
- Author:
- Eike Stepper
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceOffers additional introspection features forIBufferPools.Nested classes/interfaces inherited from interface IBufferProvider
IBufferProvider.Notification -
Method Summary
Methods inherited from interface IBufferProvider
getBufferCapacity, provideBuffer, retainBuffer
-
Method Details
-
evictOne
boolean evictOne()Tries to remove a single buffer from thisBufferPoolandreleaseit.- Returns:
trueif a buffer could be evicted,falseotherwise.
-
evict
int evict(int survivors) Tries to remove as many buffers from thisBufferPoolandreleasethem as are needed to let a given maximum number of buffers survive in the pool.- Returns:
- The number of buffers that could be evicted.
-