Class FlussSinkWriter<InputT>

  • All Implemented Interfaces:
    AutoCloseable, org.apache.flink.api.connector.sink2.SinkWriter<InputT>

    public class FlussSinkWriter<InputT>
    extends Object
    implements org.apache.flink.api.connector.sink2.SinkWriter<InputT>
    Base class for Flink SinkWriter implementations in Fluss.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.flink.api.connector.sink2.SinkWriter

        org.apache.flink.api.connector.sink2.SinkWriter.Context
    • Constructor Summary

      Constructors 
      Constructor Description
      FlussSinkWriter​(org.apache.fluss.config.Configuration flussConfig, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, FlussEventSerializer<InputT> flussRecordSerializer)  
    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • metricGroup

        protected transient org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup
    • Constructor Detail

      • FlussSinkWriter

        public FlussSinkWriter​(org.apache.fluss.config.Configuration flussConfig,
                               org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor,
                               FlussEventSerializer<InputT> flussRecordSerializer)
    • Method Detail

      • initialize

        public void initialize​(org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup)
                        throws IOException
        Throws:
        IOException
      • initMetrics

        protected void initMetrics()
      • write

        public void write​(InputT inputValue,
                          org.apache.flink.api.connector.sink2.SinkWriter.Context context)
                   throws IOException
        Specified by:
        write in interface org.apache.flink.api.connector.sink2.SinkWriter<InputT>
        Throws:
        IOException
      • flush

        public void flush​(boolean endOfInput)
                   throws IOException
        Specified by:
        flush in interface org.apache.flink.api.connector.sink2.SinkWriter<InputT>
        Throws:
        IOException
      • checkAsyncException

        protected void checkAsyncException()
                                    throws IOException
        This method should only be invoked in the mailbox thread since the counter is not volatile. Logic needs to be invoked by write AND flush since we support various semantics.
        Throws:
        IOException