Package com.linkedin.venice.pulsar.sink
Class VenicePulsarSink
java.lang.Object
com.linkedin.venice.pulsar.sink.VenicePulsarSink
- All Implemented Interfaces:
AutoCloseable
,org.apache.pulsar.io.core.Sink<org.apache.pulsar.client.api.schema.GenericObject>
public class VenicePulsarSink
extends Object
implements org.apache.pulsar.io.core.Sink<org.apache.pulsar.client.api.schema.GenericObject>
A Pulsar Sink that sends messages to Venice.
Please refer to Apache Pulsar's documentation for more information on Pulsar connectors:
https://pulsar.apache.org/docs/2.10.x/io-use/
Available configuration parameters: see VeniceSinkConfig class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getConfig
(VenicePulsarSinkConfig veniceCfg, String systemName) void
open
(VenicePulsarSinkConfig config, VeniceSystemProducer startedProducer, org.apache.pulsar.io.core.SinkContext sinkContext) to simplify unit testingvoid
protected void
throttle()
void
write
(org.apache.pulsar.functions.api.Record<org.apache.pulsar.client.api.schema.GenericObject> record)
-
Constructor Details
-
VenicePulsarSink
public VenicePulsarSink()
-
-
Method Details
-
open
public void open(Map<String, Object> cfg, org.apache.pulsar.io.core.SinkContext sinkContext) throws Exception- Specified by:
open
in interfaceorg.apache.pulsar.io.core.Sink<org.apache.pulsar.client.api.schema.GenericObject>
- Throws:
Exception
-
open
public void open(VenicePulsarSinkConfig config, VeniceSystemProducer startedProducer, org.apache.pulsar.io.core.SinkContext sinkContext) throws Exception to simplify unit testing- Throws:
Exception
-
write
public void write(org.apache.pulsar.functions.api.Record<org.apache.pulsar.client.api.schema.GenericObject> record) throws Exception - Specified by:
write
in interfaceorg.apache.pulsar.io.core.Sink<org.apache.pulsar.client.api.schema.GenericObject>
- Throws:
Exception
-
throttle
- Throws:
InterruptedException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
getConfig
-