in flink-connector-mongodb/src/main/java/org/apache/flink/connector/mongodb/sink/writer/MongoWriter.java [166:174]
public synchronized void flush(boolean endOfInput) throws IOException {
checkFlushException();
checkpointInProgress = true;
while (!bulkRequests.isEmpty() && (flushOnCheckpoint || endOfInput)) {
doBulkWrite();
}
checkpointInProgress = false;
}