Package org.apache.kafka.clients.consumer.internals
package org.apache.kafka.clients.consumer.internals
-
ClassDescriptionAbstractCoordinator implements group management for a single group member by interacting with a designated Kafka broker (the coordinator).
AbstractFetchrepresents the basic state and logic for record fetching processing.Defines the contract for handling fetch responses from brokers.Abstract assignor implementation which does some common grunt work (in particular collecting partition counts which are always needed in assignors).Sticky assignment implementation used byStickyAssignorandCooperativeStickyAssignor.AsyncClient<T1,Req extends org.apache.kafka.common.requests.AbstractRequest, Resp extends org.apache.kafka.common.requests.AbstractResponse, T2> AsyncKafkaConsumer<K,V> ThisConsumerimplementation uses anevent handlerto processapplication eventsso that the network I/O can be processed in a dedicatednetwork thread.SimpleSupplierthat caches the initial creation of the object and stores it for later calls toCachedSupplier.get().This class manages the coordination process with the consumer coordinator.ConsumerDelegate<K,V> This extension interface provides a handful of methods to expose internals of theConsumerfor various tests.ConsumerDelegateCreatorimplements a quasi-factory pattern to allow the caller to remain unaware of the underlyingConsumerimplementation that is created.ConsumerInterceptors<K,V> A container that holds the listConsumerInterceptorand wraps calls to the chain of custom interceptors.Higher level consumer access to the network layer with basic support for request futures.When invoking poll from a multi-threaded environment, it is possible that the condition that the caller is awaiting has already been satisfied prior to the invocation of poll.Background thread runnable that consumesApplicationEventand producesBackgroundEvent.ConsumerProtocol contains the schemas for consumer subscriptions and assignments for use with Kafka's generalized group management protocol.This class encapsulates the invocation of the callback methods defined in theConsumerRebalanceListenerinterface.This class just provides a static name for the methods in theConsumerRebalanceListenerinterface for a bit more compile time assurance.This is responsible for timing to send the nextFindCoordinatorRequestbased on the following criteria:Deserializers<K,V> Fetch<K,V> FetchBufferbuffers upthe resultsfrom the broker responses as they are received.FetchCollector<K,V> FetchConfigrepresents the static configuration for fetching records from Kafka.Fetcher<K,V> This class manages the fetching process with the brokers.TheFetchMetricsManagerclass provides wrapper methods to record lag, lead, latency, and fetch metrics.FetchRequestManageris responsible for generatingFetchRequestthat represent theSubscriptionState.fetchablePartitions(Predicate)based on the user's topic subscription/partition assignment.FetchUtilsprovides a place for disparate parts of the fetch logic to live.A helper class for managing the heartbeat to the coordinatorManages the request creation and response handling for the heartbeat.LegacyKafkaConsumer<K,V> A client that consumes records from a Kafka cluster using theclassic group protocol.A stateful object tracking the state of a single member in relationship to a consumer group:Group manager for a single consumer that has a group id defined in the configConsumerConfig.GROUP_ID_CONFIG, to use the Kafka-based offset management capability, and the consumer group protocol to get automatically assigned partitions when calling the subscribe API.Listener for getting notified of member ID and epoch changes.A wrapper around theNetworkClientto handle network poll and send operations.No brokers were available to complete a request.OffsetFetcheris responsible for fetching theoffsetsfor a given set oftopic and partition pairsand for validation and resetting of positions, as needed.Convenience class for making asynchronous requests to the OffsetsForLeaderEpoch APIUtility methods for preparing requests to the OffsetsForLeaderEpoch API and handling responses.Manager responsible for building the following requests to retrieve partition offsets, and processing its responses.Result of an asynchronous request fromConsumerNetworkClient.RequestFutureAdapter<F,T> Adapt from a request future of one type to another.Listener interface to hook into RequestFuture completion.PollResultconsist ofUnsentRequestif there are requests to send; otherwise, return the time till the next poll event.RequestManagersprovides a means to pass around the set ofRequestManagerinstances in the system.SensorBuildertakes a bit of the boilerplate out of creatingsensorsfor recordingmetrics.A class for tracking the topics, partitions, and offsets for the consumer.Represents the position of a partition subscription.TopicMetadataFetcheris responsible for fetching thePartitionInfofor a given set of topics.Manages the state of topic metadata requests.Ensures blocking APIs can be woken up by the consumer.wakeup().