Package com.linkedin.venice.writer
Class CompositeVeniceWriter<K,V,U>
java.lang.Object
com.linkedin.venice.writer.AbstractVeniceWriter<K,V,U>
com.linkedin.venice.writer.CompositeVeniceWriter<K,V,U>
- All Implemented Interfaces:
Closeable
,AutoCloseable
The composite writer contains a main writer and multiple child writers. The main writer will only perform the write
once all of its child writers are complete.
TODO The child writers are view writers. Ideally to avoid code duplication we should be using an array of
VeniceViewWriter here. However, the current implementation of VeniceViewWriter involves PCS which is something
specific to the ingestion path that we don't want to leak into venice-common.
-
Field Summary
Fields inherited from class com.linkedin.venice.writer.AbstractVeniceWriter
topicName
-
Constructor Summary
ConstructorDescriptionCompositeVeniceWriter
(String topicName, VeniceWriter<K, V, U> mainWriter, VeniceWriter<K, V, U>[] childWriters, PubSubProducerCallback childCallback) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
close
(boolean gracefulClose) delete
(K key, PubSubProducerCallback callback, DeleteMetadata deleteMetadata) void
flush()
put
(K key, V value, int valueSchemaId, PubSubProducerCallback callback) put
(K key, V value, int valueSchemaId, PubSubProducerCallback callback, PutMetadata putMetadata) update
(K key, U update, int valueSchemaId, int derivedSchemaId, PubSubProducerCallback callback) The main use of theCompositeVeniceWriter
for now is to write batch portion of a store version to VT and materialized view topic in the NR fabric.Methods inherited from class com.linkedin.venice.writer.AbstractVeniceWriter
getTopicName, put
-
Constructor Details
-
CompositeVeniceWriter
public CompositeVeniceWriter(String topicName, VeniceWriter<K, V, U> mainWriter, VeniceWriter<K, V, U>[] childWriters, PubSubProducerCallback childCallback)
-
-
Method Details
-
close
- Specified by:
close
in classAbstractVeniceWriter<K,
V, U> - Throws:
IOException
-
put
public CompletableFuture<PubSubProduceResult> put(K key, V value, int valueSchemaId, PubSubProducerCallback callback) - Specified by:
put
in classAbstractVeniceWriter<K,
V, U>
-
put
public Future<PubSubProduceResult> put(K key, V value, int valueSchemaId, PubSubProducerCallback callback, PutMetadata putMetadata) - Specified by:
put
in classAbstractVeniceWriter<K,
V, U>
-
delete
public CompletableFuture<PubSubProduceResult> delete(K key, PubSubProducerCallback callback, DeleteMetadata deleteMetadata) - Specified by:
delete
in classAbstractVeniceWriter<K,
V, U>
-
update
public Future<PubSubProduceResult> update(K key, U update, int valueSchemaId, int derivedSchemaId, PubSubProducerCallback callback) The main use of theCompositeVeniceWriter
for now is to write batch portion of a store version to VT and materialized view topic in the NR fabric. Updates should never go through theCompositeVeniceWriter
because it should be written to RT (hybrid writes or incremental push) and handled by view writers in L/F or A/A SIT.- Specified by:
update
in classAbstractVeniceWriter<K,
V, U>
-
flush
public void flush()- Specified by:
flush
in classAbstractVeniceWriter<K,
V, U>
-
close
- Throws:
IOException
-