@Override
    public void initializeState(FunctionInitializationContext context) throws Exception {
        if (this.inlongMetric != null) {
            this.metricStateListState = context.getOperatorStateStore().getUnionListState(
                    new ListStateDescriptor<>(
                            INLONG_METRIC_STATE_NAME, TypeInformation.of(new TypeHint<MetricState>() {
                            })));
        }
        if (context.isRestored()) {
            metricState = MetricStateUtils.restoreMetricState(metricStateListState,
                    getRuntimeContext().getIndexOfThisSubtask(), getRuntimeContext().getNumberOfParallelSubtasks());
        }
        elasticsearchSinkFunction.initializeState(context);
    }
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.13/sort-connectors/elasticsearch-base/src/main/java/org/apache/inlong/sort/elasticsearch/ElasticsearchSinkBase.java