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 temporaryChunkingAdapter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddChunkIntoContainer(CHUNKS_CONTAINER container, int chunkIndex, byte[] valueChunk)Used to incrementally add a {@param valueChunk} into the {@param CHUNKS_CONTAINER} container.CHUNKS_CONTAINERconstructChunksContainer(ChunkedValueManifest chunkedValueManifest)Used to construct the right kind of {@param CHUNKS_CONTAINER} container (according to the query code) to hold a large value which needs to be incrementally re-assembled from many smaller chunks.default VALUEconstructValue(byte[] valueOnlyBytes, int offset, int bytesLength, RecordDeserializer<VALUE> recordDeserializer, VeniceCompressor veniceCompressor)default VALUEconstructValue(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 {@param fullBytes} value fetched from the storage engine into the right type of {@param VALUE} class needed by the query code.default VALUEconstructValue(int schemaId, byte[] fullBytes)This function can be implemented by the adapters which need fewer parameters.default VALUEconstructValue(int schemaId, CHUNKS_CONTAINER chunksContainer)This function can be implemented by the adapters which need fewer parameters.default VALUEconstructValue(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 {@param CHUNKS_CONTAINER} into the right type of {@param VALUE} class needed by the query code.
-
-
-
Method Detail
-
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 {@param fullBytes} value fetched from the storage engine into the right type of {@param VALUE} 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 ofBinaryDecoderto be re-used in order to minimize GCresponseStats- theReadResponseStatswhich 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
default VALUE constructValue(int schemaId, byte[] fullBytes)
This function can be implemented by the adapters which need fewer parameters.
-
addChunkIntoContainer
void addChunkIntoContainer(CHUNKS_CONTAINER container, int chunkIndex, byte[] valueChunk)
Used to incrementally add a {@param valueChunk} into the {@param CHUNKS_CONTAINER} container.
-
constructChunksContainer
CHUNKS_CONTAINER constructChunksContainer(ChunkedValueManifest chunkedValueManifest)
Used to construct the right kind of {@param CHUNKS_CONTAINER} 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 {@param CHUNKS_CONTAINER} into the right type of {@param VALUE} 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 ofBinaryDecoderto be re-used in order to minimize GCresponseStats- theReadResponseStatswhich carries certain metrics to be recorded at the endwriterSchemaId- of the user's valuereaderSchemaId-
-
constructValue
default VALUE constructValue(int schemaId, CHUNKS_CONTAINER chunksContainer)
This function can be implemented by the adapters which need fewer parameters.
-
-