Class 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.
    • 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 testing
      void 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VenicePulsarSink

        public VenicePulsarSink()
    • 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 interface org.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 interface org.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 interface java.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)