public boolean needsDrain(long currentTimeMs) {
        return timeUntilDrain(currentTimeMs) <= 0;
    }
Check whether there are any batches which need to be drained now.

@param currentTimeMs current time in milliseconds
@return true if there are batches ready to drain, false otherwise
raft/src/main/java/org/apache/kafka/raft/internals/BatchAccumulator.java