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

    Modifier and Type
    Method
    Description
    void
     
    void
    flush(boolean endOfInput)
     
    void
    write(IN element, org.apache.flink.api.connector.sink2.SinkWriter.Context context)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.flink.api.connector.sink2.SinkWriter

    writeWatermark
  • Method Details

    • write

      public void write(IN element, org.apache.flink.api.connector.sink2.SinkWriter.Context context)
      Specified by:
      write in interface org.apache.flink.api.connector.sink2.SinkWriter<IN>
    • flush

      public void flush(boolean endOfInput)
      Specified by:
      flush in interface org.apache.flink.api.connector.sink2.SinkWriter<IN>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable