KafkaConsumer
uses the following configuration properties to create a Fetcher:
Name | Description |
---|---|
ConsumerNetworkClient that is given when |
Fetcher
takes the following when created:
-
Deserializer for keys
-
Deserializer for values
Fetcher
initializes the internal registries and counters.
Fetcher
registers itself with SubscriptionState as a listener to receive notifications about…FIXME
int sendFetches()
sendFetches
…FIXME
Note
|
sendFetches is used when KafkaConsumer is requested to poll for records.
|
RequestFuture<ClientResponse> sendMetadataRequest(MetadataRequest.Builder request)
Internally, sendMetadataRequest
requests ConsumerNetworkClient for the least loaded node.
With the node, sendMetadataRequest
requests ConsumerNetworkClient to send the request to the node.
When no node was found, sendMetadataRequest
returns a RequestFuture
with NoAvailableBrokersException
.
Note
|
sendMetadataRequest is used exclusively when Fetcher is requested for a topic metadata.
|
Map<String, List<PartitionInfo>> getTopicMetadata(
MetadataRequest.Builder request,
long timeout)
Internally, getTopicMetadata
sends the metadata request and requests ConsumerNetworkClient to poll until it finishes successfully or timeout
expires.
After poll
finishes, getTopicMetadata
takes the cluster information from MetadataResponse
.
When MetadataResponse
is successful, getTopicMetadata
takes topics (from Cluster
) and requests Cluster
for available partitions for every topic.
In the end, getTopicMetadata
creates a collection of topic and partitions pairs.
Caution
|
FIXME Describe the failure path |
Note
|
|
Map<String, List<PartitionInfo>> getAllTopicMetadata(long timeout)
getAllTopicMetadata
gets topic metadata specifying no topics (which means all topics available).
Note
|
getAllTopicMetadata is used exclusively when KafkaConsumer requests metadata for all topics.
|
RequestFuture<ListOffsetResult> sendListOffsetRequest(
final Node node,
final Map<TopicPartition, ListOffsetRequest.PartitionData> timestampsToSearch,
boolean requireTimestamp)
sendListOffsetRequest
…FIXME
Note
|
sendListOffsetRequest is used when…FIXME
|