Generic sink interface users can implement to run Sink on top of Pulsar Functions.
| 27 | * Generic sink interface users can implement to run Sink on top of Pulsar Functions. |
| 28 | */ |
| 29 | @InterfaceAudience.Public |
| 30 | @InterfaceStability.Stable |
| 31 | public interface Sink<T> extends AutoCloseable { |
| 32 | /** |
| 33 | * Open connector with configuration. |
| 34 | * |
| 35 | * @param config initialization config |
| 36 | * @param sinkContext environment where the sink connector is running |
| 37 | * @throws Exception IO type exceptions when opening a connector |
| 38 | */ |
| 39 | void open(Map<String, Object> config, SinkContext sinkContext) throws Exception; |
| 40 | |
| 41 | /** |
| 42 | * Write a message to Sink. |
| 43 | * |
| 44 | * @param record record to write to sink |
| 45 | * @throws Exception |
| 46 | */ |
| 47 | void write(Record<T> record) throws Exception; |
| 48 | } |
no outgoing calls
no test coverage detected