private void maybeCompleteDrain() {
        if (drainStatus == DrainStatus.STARTED) {
            if (currentBatch != null && currentBatch.nonEmpty()) {
                completeCurrentBatch();
            }
            // Reset the timer to a large value. The linger clock will begin
            // ticking after the next append.
            lingerTimer.reset(Long.MAX_VALUE);
            drainStatus = DrainStatus.FINISHED;
        }
    }
Append a {@link SnapshotFooterRecord} record to the batch

@param snapshotFooterRecord The record to append
@param currentTimestamp The current time in milliseconds
@throws IllegalStateException on failure to allocate a buffer for the record
raft/src/main/java/org/apache/kafka/raft/internals/BatchAccumulator.java