@Override
    public void snapshotState(FunctionSnapshotContext context) throws Exception {
        checkAsyncErrorsAndRequests();

        if (flushOnCheckpoint) {
            while (numPendingRequests.get() != 0) {
                bulkProcessor.flush();
                checkAsyncErrorsAndRequests();
            }
        }
    }
Disable flushing on checkpoint. When disabled, the sink will not wait for all pending action
requests to be acknowledged by Elasticsearch on checkpoints.

<p>NOTE: If flushing on checkpoint is disabled, the Flink Elasticsearch Sink does NOT provide
any strong guarantees for at-least-once delivery of action requests.
inlong-sort/sort-flink/sort-flink-v1.18/sort-connectors/elasticsearch-base/src/main/java/org/apache/inlong/sort/elasticsearch/ElasticsearchSinkBase.java