private void drainAll() {
        lock.lock();
        try {
            completedFetches.forEach(ShareCompletedFetch::drain);
            completedFetches.clear();
            if (nextInLineFetch != null) {
                nextInLineFetch.drain();
                nextInLineFetch = null;
            }
        } finally {
            lock.unlock();
        }
    }
Return the set of {@link TopicIdPartition partitions} for which we have data in the buffer.

@return {@link TopicIdPartition Partition} set
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetchBuffer.java