Package com.linkedin.davinci.utils
Class ChunkAssembler
- java.lang.Object
-
- com.linkedin.davinci.utils.ChunkAssembler
-
public class ChunkAssembler extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected InMemoryStorageEngine
inMemoryStorageEngine
protected java.lang.String
storeName
-
Constructor Summary
Constructors Constructor Description ChunkAssembler(java.lang.String storeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffer
bufferAndAssembleRecord(PubSubTopicPartition pubSubTopicPartition, int schemaId, byte[] keyBytes, java.nio.ByteBuffer valueBytes, long recordOffset, int readerSchemaId, VeniceCompressor compressor)
Buffers and assembles chunks of a record.<T> T
bufferAndAssembleRecord(PubSubTopicPartition pubSubTopicPartition, int schemaId, byte[] keyBytes, java.nio.ByteBuffer valueBytes, long recordOffset, Lazy<RecordDeserializer<T>> recordDeserializer, int readerSchemaId, VeniceCompressor compressor)
Buffers and assembles chunks of a record.void
clearInMemoryDB()
protected <T> T
decompressAndDeserialize(RecordDeserializer<T> deserializer, VeniceCompressor compressor, java.nio.ByteBuffer value)
-
-
-
Field Detail
-
storeName
protected final java.lang.String storeName
-
inMemoryStorageEngine
protected final InMemoryStorageEngine inMemoryStorageEngine
-
-
Method Detail
-
bufferAndAssembleRecord
public <T> T bufferAndAssembleRecord(PubSubTopicPartition pubSubTopicPartition, int schemaId, byte[] keyBytes, java.nio.ByteBuffer valueBytes, long recordOffset, Lazy<RecordDeserializer<T>> recordDeserializer, int readerSchemaId, 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 assembles, decompresses, and deserializes the record.
-
bufferAndAssembleRecord
public java.nio.ByteBuffer bufferAndAssembleRecord(PubSubTopicPartition pubSubTopicPartition, int schemaId, byte[] keyBytes, java.nio.ByteBuffer valueBytes, long recordOffset, int readerSchemaId, 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.
-
decompressAndDeserialize
protected <T> T decompressAndDeserialize(RecordDeserializer<T> deserializer, VeniceCompressor compressor, java.nio.ByteBuffer value) throws java.io.IOException
- Throws:
java.io.IOException
-
clearInMemoryDB
public void clearInMemoryDB()
-
-