Interface WriterInitContext

    • Method Detail

      • getMailboxExecutor

        MailboxExecutor getMailboxExecutor()
        Returns the mailbox executor that allows to execute Runnables inside the task thread in between record processing.

        Note that this method should not be used per-record for performance reasons in the same way as records should not be sent to the external system individually. Rather, implementers are expected to batch records and only enqueue a single Runnable per batch to handle the result.

      • isObjectReuseEnabled

        boolean isObjectReuseEnabled()
        Returns whether object reuse has been enabled or disabled.
      • createInputSerializer

        <IN> TypeSerializer<IN> createInputSerializer()
        Creates a serializer for the type of sink's input.
      • metadataConsumer

        default <MetaT> Optional<Consumer<MetaT>> metadataConsumer()
        Returns a metadata consumer, the SinkWriter can publish metadata events of type WriterInitContext to the consumer.

        It is recommended to use a separate thread pool to publish the metadata because enqueuing a lot of these messages in the mailbox may lead to a performance decrease. thread, and the Consumer.accept(T) method is executed very fast.