Interface ChunkingAdapter<CHUNKS_CONTAINER,VALUE>
- All Known Implementing Classes:
AbstractAvroChunkingAdapter
,BatchGetChunkingAdapter
,GenericChunkingAdapter
,GenericRecordChunkingAdapter
,RawBytesChunkingAdapter
,SingleGetChunkingAdapter
,SpecificRecordChunkingAdapter
public interface ChunkingAdapter<CHUNKS_CONTAINER,VALUE>
This interface allows each code path which needs to interact with chunked values
to optimize the way the re-assembly is handled so that the final form in which
the is consumed is generated as efficiently as possible, via the
use of a temporary
ChunkingAdapter
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChunkIntoContainer
(CHUNKS_CONTAINER container, int chunkIndex, byte[] valueChunk) Used to incrementally add a into the container.constructChunksContainer
(ChunkedValueManifest chunkedValueManifest) Used to construct the right kind of container (according to the query code) to hold a large value which needs to be incrementally re-assembled from many smaller chunks.default VALUE
constructValue
(byte[] valueOnlyBytes, int offset, int bytesLength, RecordDeserializer<VALUE> recordDeserializer, VeniceCompressor veniceCompressor) default VALUE
constructValue
(byte[] fullBytes, int bytesLength, VALUE reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int writerSchemaId, int readerSchemaId, StoreDeserializerCache<VALUE> storeDeserializerCache, VeniceCompressor compressor) Used to wrap a small value fetched from the storage engine into the right type of class needed by the query code.default VALUE
constructValue
(int schemaId, byte[] fullBytes) This function can be implemented by the adapters which need fewer parameters.default VALUE
constructValue
(int schemaId, CHUNKS_CONTAINER chunksContainer) This function can be implemented by the adapters which need fewer parameters.default VALUE
constructValue
(CHUNKS_CONTAINER chunksContainer, VALUE reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int writerSchemaId, int readerSchemaId, StoreDeserializerCache<VALUE> storeDeserializerCache, VeniceCompressor compressor) Used to wrap a large value re-assembled with the use of a into the right type of class needed by the query code.
-
Method Details
-
constructValue
default VALUE constructValue(byte[] fullBytes, int bytesLength, VALUE reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int writerSchemaId, int readerSchemaId, StoreDeserializerCache<VALUE> storeDeserializerCache, VeniceCompressor compressor) Used to wrap a small value fetched from the storage engine into the right type of class needed by the query code.The following parameters are mandatory:
- Parameters:
fullBytes
- includes both the schema ID header and the payloadThe following parameters can be ignored, by implementing
constructValue(int, byte[])
:bytesLength
-reusedValue
- a previous instance of to be re-used in order to minimize GCreusedDecoder
- a previous instance ofBinaryDecoder
to be re-used in order to minimize GCresponseStats
- theReadResponseStats
which carries certain metrics to be recorded at the endwriterSchemaId
- schema used to serialize the valuereaderSchemaId
-
-
constructValue
default VALUE constructValue(byte[] valueOnlyBytes, int offset, int bytesLength, RecordDeserializer<VALUE> recordDeserializer, VeniceCompressor veniceCompressor) -
constructValue
This function can be implemented by the adapters which need fewer parameters. -
addChunkIntoContainer
Used to incrementally add a into the container. -
constructChunksContainer
Used to construct the right kind of container (according to the query code) to hold a large value which needs to be incrementally re-assembled from many smaller chunks. -
constructValue
default VALUE constructValue(CHUNKS_CONTAINER chunksContainer, VALUE reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int writerSchemaId, int readerSchemaId, StoreDeserializerCache<VALUE> storeDeserializerCache, VeniceCompressor compressor) Used to wrap a large value re-assembled with the use of a into the right type of class needed by the query code.The following parameters are mandatory:
- Parameters:
chunksContainer
- temporary , obtained fromconstructChunksContainer(ChunkedValueManifest)
The following parameters can be ignored, by implementing
constructValue(int, Object)
:reusedValue
- a previous instance of to be re-used in order to minimize GCreusedDecoder
- a previous instance ofBinaryDecoder
to be re-used in order to minimize GCresponseStats
- theReadResponseStats
which carries certain metrics to be recorded at the endwriterSchemaId
- of the user's valuereaderSchemaId
-
-
constructValue
This function can be implemented by the adapters which need fewer parameters.
-