Class DelegatingTrackingCallback<K,V>
- java.lang.Object
-
- com.linkedin.venice.client.store.streaming.DelegatingTrackingCallback<K,V>
-
- All Implemented Interfaces:
StreamingCallback<K,V>
,TrackingStreamingCallback<K,V>
- Direct Known Subclasses:
ClientComputeRecordStreamDecoder.Callback
public class DelegatingTrackingCallback<K,V> extends java.lang.Object implements TrackingStreamingCallback<K,V>
-
-
Constructor Summary
Constructors Constructor Description DelegatingTrackingCallback(StreamingCallback<K,V> inner)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ClientStats>
getStats()
void
onCompletion(java.util.Optional<java.lang.Exception> exception)
This will be invoked when the callbacks are fully executed.void
onDeserializationCompletion(java.util.Optional<java.lang.Exception> exception, int successKeyCount, int duplicateEntryCount)
This will be invoked when Venice Client deserialization is done.void
onRecordDeserialized()
This will be invoked when any record deserialization happens.void
onRecordReceived(K key, V value)
This function will be invoked when some records are ready to be consumed.static <K,V>
TrackingStreamingCallback<K,V>wrap(StreamingCallback<K,V> callback)
-
-
-
Constructor Detail
-
DelegatingTrackingCallback
public DelegatingTrackingCallback(StreamingCallback<K,V> inner)
-
-
Method Detail
-
onRecordReceived
public void onRecordReceived(K key, V value)
Description copied from interface:StreamingCallback
This function will be invoked when some records are ready to be consumed. This function could be invoked in parallel when data records arrive at the same time, and if you want to need to do sequential processing, you need to synchronize it in the customizedStreamingCallback.onRecordReceived(Object, Object)
.- Specified by:
onRecordReceived
in interfaceStreamingCallback<K,V>
value
- : could be null when key doesn't exist in Venice.
-
onCompletion
public void onCompletion(java.util.Optional<java.lang.Exception> exception)
Description copied from interface:StreamingCallback
This will be invoked when the callbacks are fully executed.- Specified by:
onCompletion
in interfaceStreamingCallback<K,V>
- Parameters:
exception
- Exception thrown when processing result from Venice.
-
getStats
public java.util.Optional<ClientStats> getStats()
- Specified by:
getStats
in interfaceTrackingStreamingCallback<K,V>
-
onRecordDeserialized
public void onRecordDeserialized()
Description copied from interface:TrackingStreamingCallback
This will be invoked when any record deserialization happens.- Specified by:
onRecordDeserialized
in interfaceTrackingStreamingCallback<K,V>
-
onDeserializationCompletion
public void onDeserializationCompletion(java.util.Optional<java.lang.Exception> exception, int successKeyCount, int duplicateEntryCount)
Description copied from interface:TrackingStreamingCallback
This will be invoked when Venice Client deserialization is done.- Specified by:
onDeserializationCompletion
in interfaceTrackingStreamingCallback<K,V>
successKeyCount
- , this param indicates the total number of existing keys
-
wrap
public static <K,V> TrackingStreamingCallback<K,V> wrap(StreamingCallback<K,V> callback)
-
-