public synchronized void write()

in flink-connector-mongodb/src/main/java/org/apache/flink/connector/mongodb/sink/writer/MongoWriter.java [149:163]


    public synchronized void write(IN element, Context context)
            throws IOException, InterruptedException {
        checkFlushException();

        // do not allow new bulk writes until all actions are flushed
        while (checkpointInProgress) {
            mailboxExecutor.yield();
        }
        WriteModel<BsonDocument> writeModel = serializationSchema.serialize(element, sinkContext);
        numRecordsOut.inc();
        collector.collect(writeModel);
        if (isOverMaxBatchSizeLimit() || isOverMaxBatchIntervalLimit()) {
            doBulkWrite();
        }
    }