Package com.linkedin.venice.pulsar.sink
Class VenicePulsarSink
- java.lang.Object
-
- com.linkedin.venice.pulsar.sink.VenicePulsarSink
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.apache.pulsar.io.core.Sink<org.apache.pulsar.client.api.schema.GenericObject>
public class VenicePulsarSink extends java.lang.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
Constructors Constructor Description VenicePulsarSink()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static java.util.Map<java.lang.String,java.lang.String>
getConfig(VenicePulsarSinkConfig veniceCfg, java.lang.String systemName)
void
open(VenicePulsarSinkConfig config, VeniceSystemProducer startedProducer, org.apache.pulsar.io.core.SinkContext sinkContext)
to simplify unit testingvoid
open(java.util.Map<java.lang.String,java.lang.Object> cfg, org.apache.pulsar.io.core.SinkContext sinkContext)
protected void
throttle()
void
write(org.apache.pulsar.functions.api.Record<org.apache.pulsar.client.api.schema.GenericObject> record)
-
-
-
Method Detail
-
open
public void open(java.util.Map<java.lang.String,java.lang.Object> cfg, org.apache.pulsar.io.core.SinkContext sinkContext) throws java.lang.Exception
- Specified by:
open
in interfaceorg.apache.pulsar.io.core.Sink<org.apache.pulsar.client.api.schema.GenericObject>
- Throws:
java.lang.Exception
-
open
public void open(VenicePulsarSinkConfig config, VeniceSystemProducer startedProducer, org.apache.pulsar.io.core.SinkContext sinkContext) throws java.lang.Exception
to simplify unit testing- Throws:
java.lang.Exception
-
write
public void write(org.apache.pulsar.functions.api.Record<org.apache.pulsar.client.api.schema.GenericObject> record) throws java.lang.Exception
- Specified by:
write
in interfaceorg.apache.pulsar.io.core.Sink<org.apache.pulsar.client.api.schema.GenericObject>
- Throws:
java.lang.Exception
-
throttle
protected void throttle() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
getConfig
public static java.util.Map<java.lang.String,java.lang.String> getConfig(VenicePulsarSinkConfig veniceCfg, java.lang.String systemName)
-
-