Class ChunkAssembler


  • public class ChunkAssembler
    extends java.lang.Object
    • Field Detail

      • storeName

        protected final java.lang.String storeName
    • Constructor Detail

      • ChunkAssembler

        public ChunkAssembler​(java.lang.String storeName)
    • 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()