private String instantToWrite() {
        String instant = lastPendingInstant();
        // if exactly-once semantics turns on,
        // waits for the checkpoint notification until the checkpoint timeout threshold hits.
        TimeWait timeWait = TimeWait.builder()
                .timeout(config.getLong(FlinkOptions.WRITE_COMMIT_ACK_TIMEOUT))
                .action("instant initialize")
                .build();
        while (instant == null || instant.equals(this.initInstant)) {
            // wait condition:
            // 1. there is no inflight instant
            // 2. the inflight instant does not change
            // sleep for a while
            timeWait.waitFor();
            // refresh the inflight instant
            instant = lastPendingInstant();
        }
        return instant;
    }
Returns the last pending instant time.
inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/hudi/src/main/java/org/apache/inlong/sort/hudi/sink/bulk/BulkInsertWriteFunction.java