Class FlussSinkWriter<InputT>
- java.lang.Object
-
- org.apache.flink.cdc.connectors.fluss.sink.v2.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 FlinkSinkWriterimplementations in Fluss.
-
-
Field Summary
Fields Modifier and Type Field Description protected WrapperFlussMetricRegistryflinkMetricRegistryprotected static org.slf4j.LoggerLOGprotected org.apache.flink.metrics.groups.SinkWriterMetricGroupmetricGroup
-
Constructor Summary
Constructors Constructor Description FlussSinkWriter(org.apache.fluss.config.Configuration flussConfig, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, FlussEventSerializer<InputT> flussRecordSerializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckAsyncException()This method should only be invoked in the mailbox thread since the counter is not volatile.voidclose()voidflush(boolean endOfInput)voidinitialize(org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup)protected voidinitMetrics()voidwrite(InputT inputValue, org.apache.flink.api.connector.sink2.SinkWriter.Context context)
-
-
-
Field Detail
-
LOG
protected static final org.slf4j.Logger LOG
-
flinkMetricRegistry
protected transient WrapperFlussMetricRegistry flinkMetricRegistry
-
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:
writein interfaceorg.apache.flink.api.connector.sink2.SinkWriter<InputT>- Throws:
IOException
-
flush
public void flush(boolean endOfInput) throws IOException- Specified by:
flushin interfaceorg.apache.flink.api.connector.sink2.SinkWriter<InputT>- Throws:
IOException
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
checkAsyncException
protected void checkAsyncException() throws IOExceptionThis 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
-
-