Package com.linkedin.davinci.utils
Class ChunkAssembler
java.lang.Object
com.linkedin.davinci.utils.ChunkAssembler
- Direct Known Subclasses:
InMemoryChunkAssembler,RocksDBChunkAssembler
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChunkAssembler(StorageEngine bufferStorageEngine, boolean skipFailedToAssembleRecords) -
Method Summary
Modifier and TypeMethodDescriptionbufferAndAssembleRecord(PubSubTopicPartition pubSubTopicPartition, int schemaId, byte[] keyBytes, ByteBuffer valueBytes, PubSubPosition recordOffset, VeniceCompressor compressor) Buffers and assembles chunks of a record.voidstatic ByteBufferdecompressValueIfNeeded(ByteBuffer value, int schemaId, VeniceCompressor compressor) For chunked records, the chunk assembler already decompresses the assembled value via RawBytesChunkingAdapter's decompressingInputStreamDecoder.static booleanisChunkedRecord(int schemaId)
-
Field Details
-
bufferStorageEngine
-
-
Constructor Details
-
ChunkAssembler
-
-
Method Details
-
bufferAndAssembleRecord
public ByteBufferValueRecord<ByteBuffer> bufferAndAssembleRecord(PubSubTopicPartition pubSubTopicPartition, int schemaId, byte[] keyBytes, ByteBuffer valueBytes, PubSubPosition recordOffset, VeniceCompressor compressor) Buffers and assembles chunks of a record. If the record is chunked, it stores the chunks and returns null. Once all chunks of a record are received, it returns the compressed and serialized assembled record. -
clearBuffer
public void clearBuffer() -
isChunkedRecord
public static boolean isChunkedRecord(int schemaId) -
decompressValueIfNeeded
public static ByteBuffer decompressValueIfNeeded(ByteBuffer value, int schemaId, VeniceCompressor compressor) throws IOException For chunked records, the chunk assembler already decompresses the assembled value via RawBytesChunkingAdapter's decompressingInputStreamDecoder. For non-chunked records, the value is still compressed and needs explicit decompression here.- Throws:
IOException
-