Package one.microstream.storage.types
Class StorageDataFileItemIterator.BufferProvider.ConstantSizedBufferProvider
- java.lang.Object
-
- one.microstream.storage.types.StorageDataFileItemIterator.BufferProvider.ConstantSizedBufferProvider
-
- All Implemented Interfaces:
StorageDataFileItemIterator.BufferProvider
- Enclosing interface:
- StorageDataFileItemIterator.BufferProvider
public static final class StorageDataFileItemIterator.BufferProvider.ConstantSizedBufferProvider extends Object implements StorageDataFileItemIterator.BufferProvider
Simple implementation that provides always the sameByteBufferinstance with a fixed size. This is sufficient for reading all entity headers and having the data available for caching of "small" entities. Normally, the buffer size is downwards capped at the system's page size which also proved to be the optimal buffer size (anything large gives no significant advantage, anything lower dramatically reduces performance. Both not surprising, given the fundamental meaning of a page size).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageDataFileItemIterator.BufferProvider
StorageDataFileItemIterator.BufferProvider.ConstantSizedBufferProvider
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferprovideBuffer(ByteBuffer byteBuffer, long nextEntityLength)The passed and returned byte buffer instances are guaranteed to be direct bytebuffer.ByteBufferprovideInitialBuffer()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface one.microstream.storage.types.StorageDataFileItemIterator.BufferProvider
cleanUp
-
-
-
-
Method Detail
-
provideInitialBuffer
public final ByteBuffer provideInitialBuffer()
- Specified by:
provideInitialBufferin interfaceStorageDataFileItemIterator.BufferProvider
-
provideBuffer
public final ByteBuffer provideBuffer(ByteBuffer byteBuffer, long nextEntityLength)
Description copied from interface:StorageDataFileItemIterator.BufferProviderThe passed and returned byte buffer instances are guaranteed to be direct bytebuffer. This has to be ensured via contract instead of proper typing because of the lack of competent typing in the JDK. All byte buffer instances passed to this method are guaranteed to have been created by it. SeeStorageDataFileItemIterator.BufferProvider.provideInitialBuffer().- Specified by:
provideBufferin interfaceStorageDataFileItemIterator.BufferProvider- Parameters:
byteBuffer- the direct byte buffer used so far.nextEntityLength- the length of the next entity to be read to the buffer.- Returns:
- a byte buffer of appropriate size to hold the next entity's data to be processed sufficiently.
-
-