Interface Sink<T>

All Superinterfaces:
AutoCloseable

@Public @Stable public interface Sink<T> extends AutoCloseable
Generic sink interface users can implement to run Sink on top of Pulsar Functions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    open(Map<String,Object> config, SinkContext sinkContext)
    Open connector with configuration.
    void
    write(Record<T> record)
    Write a message to Sink.

    Methods inherited from interface java.lang.AutoCloseable

    close
  • Method Details

    • open

      void open(Map<String,Object> config, SinkContext sinkContext) throws Exception
      Open connector with configuration.
      Parameters:
      config - initialization config
      sinkContext - environment where the sink connector is running
      Throws:
      Exception - IO type exceptions when opening a connector
    • write

      void write(Record<T> record) throws Exception
      Write a message to Sink.
      Parameters:
      record - record to write to sink
      Throws:
      Exception