private void prepareFetchOffsetsRequests(final Map<TopicPartition, Long> timestampsToSearch,
                                             final boolean requireTimestamps,
                                             final ListOffsetsRequestState listOffsetsRequestState) {
        try {
            List<NetworkClientDelegate.UnsentRequest> unsentRequests = buildListOffsetsRequests(
                    timestampsToSearch, requireTimestamps, listOffsetsRequestState);
            requestsToSend.addAll(unsentRequests);
        } catch (StaleMetadataException e) {
            requestsToRetry.add(listOffsetsRequestState);
        }
    }
Generate requests for partitions with known leaders. Update the listOffsetsRequestState by adding
partitions with unknown leader to the listOffsetsRequestState.remainingToSearch
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetsRequestManager.java