Package ai.chalk.flink.sink
Class ChalkSinkWriter<IN>
java.lang.Object
ai.chalk.flink.sink.ChalkSinkWriter<IN>
- Type Parameters:
IN- the stream element type
- All Implemented Interfaces:
AutoCloseable,org.apache.flink.api.connector.sink2.SinkWriter<IN>
public class ChalkSinkWriter<IN>
extends Object
implements org.apache.flink.api.connector.sink2.SinkWriter<IN>
SinkWriter that batches feature rows and uploads them via Chalk upload_features.
One instance per parallel subtask, created by ChalkSink.createWriter(org.apache.flink.api.connector.sink2.Sink.InitContext).
Flink invokes flush(boolean) on every checkpoint barrier (and at end-of-input), which
drains the buffer — this is what gives at-least-once alignment on the Sink2 API. Upload latency
is therefore bounded by the smaller of the configured flush interval and the checkpoint interval.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.api.connector.sink2.SinkWriter
org.apache.flink.api.connector.sink2.SinkWriter.Context -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.api.connector.sink2.SinkWriter
writeWatermark
-
Method Details
-
write
- Specified by:
writein interfaceorg.apache.flink.api.connector.sink2.SinkWriter<IN>
-
flush
public void flush(boolean endOfInput) - Specified by:
flushin interfaceorg.apache.flink.api.connector.sink2.SinkWriter<IN>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-