Package one.microstream.storage.types
Class StorageDataConverterTypeBinaryToCsv.UTF8
java.lang.Object
one.microstream.storage.types.StorageDataConverterTypeBinaryToCsv.UTF8
- All Implemented Interfaces:
StorageDataConverterTypeBinaryToCsv
,StorageDataFileItemIterator.BufferProvider
,StorageDataFileItemIterator.ItemProcessor
- Enclosing interface:
- StorageDataConverterTypeBinaryToCsv
public static final class StorageDataConverterTypeBinaryToCsv.UTF8 extends Object implements StorageDataConverterTypeBinaryToCsv, StorageDataFileItemIterator.BufferProvider, StorageDataFileItemIterator.ItemProcessor
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageDataConverterTypeBinaryToCsv
StorageDataConverterTypeBinaryToCsv.TypeNameMapper, StorageDataConverterTypeBinaryToCsv.UTF8
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageDataFileItemIterator.BufferProvider
StorageDataFileItemIterator.BufferProvider.ConstantSizedBufferProvider
-
Constructor Summary
Constructors Constructor Description UTF8(StorageDataConverterCsvConfiguration configuration, StorageEntityTypeConversionFileProvider fileProvider, PersistenceTypeDictionary typeDictionary, StorageDataConverterTypeBinaryToCsv.TypeNameMapper typeNameMapper, int readBufferSize, int writeBufferSize)
-
Method Summary
Modifier and Type Method Description boolean
accept(long entityAddress, long availableEntityLength)
Processes the entity at the given address for the passed availableEntityLength.void
convertDataFile(AReadableFile file)
ByteBuffer
provideBuffer(ByteBuffer byteBuffer, long nextEntityLength)
The passed and returned byte buffer instances are guaranteed to be direct bytebuffer.ByteBuffer
provideInitialBuffer()
static byte
toHexadecimal(int b)
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
-
Constructor Details
-
UTF8
public UTF8(StorageDataConverterCsvConfiguration configuration, StorageEntityTypeConversionFileProvider fileProvider, PersistenceTypeDictionary typeDictionary, StorageDataConverterTypeBinaryToCsv.TypeNameMapper typeNameMapper, int readBufferSize, int writeBufferSize)
-
-
Method Details
-
toHexadecimal
- Throws:
IllegalArgumentException
-
convertDataFile
- Specified by:
convertDataFile
in interfaceStorageDataConverterTypeBinaryToCsv
-
accept
public boolean accept(long entityAddress, long availableEntityLength)Description copied from interface:StorageDataFileItemIterator.ItemProcessor
Processes the entity at the given address for the passed availableEntityLength. If the available length is not sufficient (i.e. the processor requires the full entity but the available data is incomplete), the processor aborts and returns false, signaling the iterator to reload the entity in the next batch in full. Otherwise, the processor processes the entity (e.g. only register header values) and returns true.- Specified by:
accept
in interfaceStorageDataFileItemIterator.ItemProcessor
- Parameters:
entityAddress
- the address at which the entity data is located (starting with the entity header).availableEntityLength
- the remaining entity data in the buffer, potentially less then the actual entity length.- Returns:
- true if the entity has been processed, false (impliying recall) otherwise.
-
provideInitialBuffer
- Specified by:
provideInitialBuffer
in interfaceStorageDataFileItemIterator.BufferProvider
-
provideBuffer
Description copied from interface:StorageDataFileItemIterator.BufferProvider
The 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:
provideBuffer
in 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 apriorate size to hold the next entity's data to be processed sufficiently.
-