Class AbstractAvroChunkingAdapter<T>
java.lang.Object
com.linkedin.davinci.storage.chunking.AbstractAvroChunkingAdapter<T>
- All Implemented Interfaces:
ChunkingAdapter<ChunkedValueInputStream,
T>
- Direct Known Subclasses:
GenericChunkingAdapter
,RawBytesChunkingAdapter
,SpecificRecordChunkingAdapter
public abstract class AbstractAvroChunkingAdapter<T>
extends Object
implements ChunkingAdapter<ChunkedValueInputStream,T>
Read compute and write compute chunking adapter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChunkIntoContainer
(ChunkedValueInputStream chunkedValueInputStream, 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.constructValue
(byte[] valueOnlyBytes, int offset, int bytesLength, RecordDeserializer<T> recordDeserializer, VeniceCompressor veniceCompressor) constructValue
(byte[] fullBytes, int bytesLength, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int writerSchemaId, int readerSchemaId, StoreDeserializerCache<T> 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.constructValue
(ChunkedValueInputStream chunkedValueInputStream, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int writerSchemaId, int readerSchemaId, StoreDeserializerCache<T> 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.get
(AbstractStorageEngine store, int partition, byte[] key, ByteBuffer reusedRawValue, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, boolean isChunked, ReadResponseStats responseStats, int readerSchemaId, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor) get
(AbstractStorageEngine store, int partition, ByteBuffer key, boolean isChunked, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int readerSchemaId, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor, ChunkedValueManifestContainer manifestContainer) void
getByPartialKey
(AbstractStorageEngine store, int userPartition, byte[] keyPrefixBytes, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, RecordDeserializer<org.apache.avro.generic.GenericRecord> keyRecordDeserializer, boolean isChunked, int readerSchemaId, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor, StreamingCallback<org.apache.avro.generic.GenericRecord, org.apache.avro.generic.GenericRecord> computingCallback) getWithSchemaId
(AbstractStorageEngine store, int partition, ByteBuffer key, boolean isChunked, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor, ChunkedValueManifestContainer manifestContainer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linkedin.davinci.storage.chunking.ChunkingAdapter
constructValue, constructValue
-
Constructor Details
-
AbstractAvroChunkingAdapter
public AbstractAvroChunkingAdapter()
-
-
Method Details
-
constructValue
public T constructValue(byte[] fullBytes, int bytesLength, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int writerSchemaId, int readerSchemaId, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor) Description copied from interface:ChunkingAdapter
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:
- Specified by:
constructValue
in interfaceChunkingAdapter<ChunkedValueInputStream,
T> - Parameters:
fullBytes
- includes both the schema ID header and the payloadThe following parameters can be ignored, by implementing
ChunkingAdapter.constructValue(int, byte[])
: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 value
-
constructValue
public T constructValue(byte[] valueOnlyBytes, int offset, int bytesLength, RecordDeserializer<T> recordDeserializer, VeniceCompressor veniceCompressor) - Specified by:
constructValue
in interfaceChunkingAdapter<ChunkedValueInputStream,
T>
-
addChunkIntoContainer
public void addChunkIntoContainer(ChunkedValueInputStream chunkedValueInputStream, int chunkIndex, byte[] valueChunk) Description copied from interface:ChunkingAdapter
Used to incrementally add a into the container.- Specified by:
addChunkIntoContainer
in interfaceChunkingAdapter<ChunkedValueInputStream,
T>
-
constructChunksContainer
Description copied from interface:ChunkingAdapter
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.- Specified by:
constructChunksContainer
in interfaceChunkingAdapter<ChunkedValueInputStream,
T>
-
constructValue
public T constructValue(ChunkedValueInputStream chunkedValueInputStream, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int writerSchemaId, int readerSchemaId, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor) Description copied from interface:ChunkingAdapter
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:
- Specified by:
constructValue
in interfaceChunkingAdapter<ChunkedValueInputStream,
T> - Parameters:
chunkedValueInputStream
- temporary , obtained fromChunkingAdapter.constructChunksContainer(ChunkedValueManifest)
The following parameters can be ignored, by implementing
ChunkingAdapter.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 value
-
get
public T get(AbstractStorageEngine store, int partition, ByteBuffer key, boolean isChunked, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, ReadResponseStats responseStats, int readerSchemaId, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor, ChunkedValueManifestContainer manifestContainer) -
getWithSchemaId
public ByteBufferValueRecord<T> getWithSchemaId(AbstractStorageEngine store, int partition, ByteBuffer key, boolean isChunked, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor, ChunkedValueManifestContainer manifestContainer) -
get
public T get(AbstractStorageEngine store, int partition, byte[] key, ByteBuffer reusedRawValue, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, boolean isChunked, ReadResponseStats responseStats, int readerSchemaId, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor) -
getByPartialKey
public void getByPartialKey(AbstractStorageEngine store, int userPartition, byte[] keyPrefixBytes, T reusedValue, org.apache.avro.io.BinaryDecoder reusedDecoder, RecordDeserializer<org.apache.avro.generic.GenericRecord> keyRecordDeserializer, boolean isChunked, int readerSchemaId, StoreDeserializerCache<T> storeDeserializerCache, VeniceCompressor compressor, StreamingCallback<org.apache.avro.generic.GenericRecord, org.apache.avro.generic.GenericRecord> computingCallback)
-