Class AbstractRecordStreamDecoder<ENVELOPE,K,V>
java.lang.Object
com.linkedin.venice.client.store.streaming.AbstractRecordStreamDecoder<ENVELOPE,K,V>
- Type Parameters:
ENVELOPE-K-V-
- All Implemented Interfaces:
RecordStreamDecoder,TransportClientStreamingCallback
- Direct Known Subclasses:
ComputeRecordStreamDecoder,MultiGetRecordStreamDecoder
public abstract class AbstractRecordStreamDecoder<ENVELOPE,K,V>
extends Object
implements RecordStreamDecoder
Streaming callback for batch-get/compute.
Since data chunk returned by
D2TransportClient doesn't respect chunk-size associated with each
chunk sent by Venice Router, here is leveraging ReadEnvelopeChunkedDeserializer to deserialize
data chunks even with the data chunk contains partial record in a non-blocking way.
The envelope deserialization will happen in TransportClient thread pool (R2 thread pool for example if using
D2TransportClient, and both the record deserialization and application's callback will be executed in
Venice thread pool: deserializationExecutor,-
Constructor Summary
ConstructorsConstructorDescriptionAbstractRecordStreamDecoder(List<K> keyList, TrackingStreamingCallback<K, V> callback, Executor deserializationExecutor) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ReadEnvelopeChunkedDeserializer<ENVELOPE>getEnvelopeDeserializer(int schemaId) protected abstract intgetKeyIndex(ENVELOPE envelope) protected abstract StreamingFooterRecordV1getStreamingFooterRecord(ENVELOPE envelope) protected abstract VgetValueRecord(ENVELOPE envelope, CompressionStrategy compression) voidonCompletion(Optional<VeniceClientException> exception) This will be invoked when the response is fully completed.voidonDataReceived(ByteBuffer chunk) This will be invoked when a new data chunk is available.voidonHeaderReceived(Map<String, String> headers) This will be invoked when headers are available.
-
Constructor Details
-
AbstractRecordStreamDecoder
-
-
Method Details
-
onHeaderReceived
Description copied from interface:TransportClientStreamingCallbackThis will be invoked when headers are available.- Specified by:
onHeaderReceivedin interfaceTransportClientStreamingCallback
-
onDataReceived
Description copied from interface:TransportClientStreamingCallbackThis will be invoked when a new data chunk is available.- Specified by:
onDataReceivedin interfaceTransportClientStreamingCallback
-
onCompletion
Description copied from interface:TransportClientStreamingCallbackThis will be invoked when the response is fully completed. When any error happens, will contain the underlying exception.- Specified by:
onCompletionin interfaceTransportClientStreamingCallback
-
getEnvelopeDeserializer
-
getValueRecord
-
getKeyIndex
-