Class RedisSink

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.apache.pulsar.io.core.Sink<byte[]>

    public class RedisSink
    extends java.lang.Object
    implements org.apache.pulsar.io.core.Sink<byte[]>
    A Simple Redis sink, which stores the key/value records from Pulsar in redis. Note that records from Pulsar with null keys or values will be ignored. This class expects records from Pulsar to have a key and value that are stored as bytes or a string.
    • Constructor Summary

      Constructors 
      Constructor Description
      RedisSink()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void open​(java.util.Map<java.lang.String,​java.lang.Object> config, org.apache.pulsar.io.core.SinkContext sinkContext)  
      void write​(org.apache.pulsar.functions.api.Record<byte[]> record)  
      • Methods inherited from class java.lang.Object

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

      • RedisSink

        public RedisSink()
    • Method Detail

      • open

        public void open​(java.util.Map<java.lang.String,​java.lang.Object> config,
                         org.apache.pulsar.io.core.SinkContext sinkContext)
                  throws java.lang.Exception
        Specified by:
        open in interface org.apache.pulsar.io.core.Sink<byte[]>
        Throws:
        java.lang.Exception
      • write

        public void write​(org.apache.pulsar.functions.api.Record<byte[]> record)
                   throws java.lang.Exception
        Specified by:
        write in interface org.apache.pulsar.io.core.Sink<byte[]>
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception