Class BatchingVeniceWriter<K,V,U>

java.lang.Object
com.linkedin.venice.writer.AbstractVeniceWriter<K,V,U>
com.linkedin.venice.writer.BatchingVeniceWriter<K,V,U>
All Implemented Interfaces:
Closeable, AutoCloseable

public class BatchingVeniceWriter<K,V,U> extends AbstractVeniceWriter<K,V,U>
This class is a batching implementation of VeniceWriter. The intention of this class is to: (1) Reduce message volumes sent to Venice backend. (2) Avoid generating messages for the same key with the same timestamp for the same writer. Today's Active/Active DCR algorithm will compare field value to break tie when two messages arrive with the same timestamp. This makes sure this case will not happen if each key is only produced by single writer and user will always see the latest value in the producing order. There are two configs that control the batching behavior: (1) Max batch interval: Maximum delay of a batch of records before it is produced. (2) Max batch buffer size: Maximum size of buffer records before it is produced. If any of the limit is reached, the buffered batch will be flushed and produced. For messages within the same batch, only the last one will be produced into the topic, except for those mentioned below. (1) UPDATE message: It will be supported in the future. (2) Message with logical timestamp: It will be sent out individually. When the last message is produced, its callback will be completed (either successfully or exceptionally), all the related messages' callbacks will also be completed with the same result.