@Override
    public void afterBulk(long executionId, BulkRequest request, Throwable failure) {
        LOG.error("afterBulk,executionId:" + executionId + ",failure:" + failure, failure);
        String errorMsg = String.format("EsSenderError,whole bulk,errorMsg:%s,count:%d", failure.getMessage(),
                request.numberOfActions());
        LOG.error(errorMsg, failure);

        // monitor
        List<DocWriteRequest<?>> requests = request.requests();
        for (int i = 0; i < requests.size(); i++) {
            EsIndexRequest requestItem = (EsIndexRequest) requests.get(i);
            ProfileEvent event = requestItem.getEvent();
            long sendTime = requestItem.getSendTime();
            context.addSendResultMetric(event, context.getTaskName(), false, sendTime);
            context.backDispatchQueue(requestItem);
        }
    }
afterBulk

@param executionId
@param request
@param failure
inlong-sort-standalone/sort-standalone-source/src/main/java/org/apache/inlong/sort/standalone/sink/elasticsearch/EsCallbackListener.java