public boolean beginFlush() {
        try {
            return beginFlush(0, TimeUnit.NANOSECONDS);
        } catch (InterruptedException | TimeoutException e) {
            log.error("Invalid call to OffsetStorageWriter beginFlush() while already flushing, the "
                    + "framework should not allow this");
            throw new ConnectException("OffsetStorageWriter is already flushing");
        }
    }
Performs the first step of a flush operation, snapshotting the current state. This does not
actually initiate the flush with the underlying storage. Ensures that any previous flush operations
have finished before beginning a new flush.

@return true if a flush was initiated, false if no data was available
@throws ConnectException if the previous flush is not complete before this method is called
connect/runtime/src/main/java/org/apache/kafka/connect/storage/OffsetStorageWriter.java