Class ListOffsetsHandler
java.lang.Object
org.apache.kafka.clients.admin.internals.AdminApiHandler.Batched<org.apache.kafka.common.TopicPartition,ListOffsetsResult.ListOffsetsResultInfo>
org.apache.kafka.clients.admin.internals.ListOffsetsHandler
- All Implemented Interfaces:
AdminApiHandler<org.apache.kafka.common.TopicPartition,ListOffsetsResult.ListOffsetsResultInfo>
public final class ListOffsetsHandler
extends AdminApiHandler.Batched<org.apache.kafka.common.TopicPartition,ListOffsetsResult.ListOffsetsResultInfo>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.kafka.clients.admin.internals.AdminApiHandler
AdminApiHandler.ApiResult<K,V>, AdminApiHandler.Batched<K, V>, AdminApiHandler.RequestAndKeys<K>, AdminApiHandler.Unbatched<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionListOffsetsHandler(Map<org.apache.kafka.common.TopicPartition, Long> offsetTimestampsByPartition, ListOffsetsOptions options, org.apache.kafka.common.utils.LogContext logContext) -
Method Summary
Modifier and TypeMethodDescriptionapiName()Get a user-friendly name for the API this handler is implementing.AdminApiHandler.ApiResult<org.apache.kafka.common.TopicPartition, ListOffsetsResult.ListOffsetsResultInfo> handleResponse(org.apache.kafka.common.Node broker, Set<org.apache.kafka.common.TopicPartition> keys, org.apache.kafka.common.requests.AbstractResponse abstractResponse) Callback that is invoked when a request returns successfully.handleUnsupportedVersionException(int brokerId, org.apache.kafka.common.errors.UnsupportedVersionException exception, Set<org.apache.kafka.common.TopicPartition> keys) Callback that is invoked when a fulfillment request hits an UnsupportedVersionException.AdminApiLookupStrategy<org.apache.kafka.common.TopicPartition> Get the lookup strategy that is responsible for finding the brokerId which will handle each respective key.static AdminApiFuture.SimpleAdminApiFuture<org.apache.kafka.common.TopicPartition, ListOffsetsResult.ListOffsetsResultInfo> newFuture(Collection<org.apache.kafka.common.TopicPartition> topicPartitions) Methods inherited from class org.apache.kafka.clients.admin.internals.AdminApiHandler.Batched
buildRequest
-
Constructor Details
-
ListOffsetsHandler
public ListOffsetsHandler(Map<org.apache.kafka.common.TopicPartition, Long> offsetTimestampsByPartition, ListOffsetsOptions options, org.apache.kafka.common.utils.LogContext logContext)
-
-
Method Details
-
apiName
Description copied from interface:AdminApiHandlerGet a user-friendly name for the API this handler is implementing. -
lookupStrategy
Description copied from interface:AdminApiHandlerGet the lookup strategy that is responsible for finding the brokerId which will handle each respective key.- Returns:
- non-null lookup strategy
-
handleResponse
public AdminApiHandler.ApiResult<org.apache.kafka.common.TopicPartition,ListOffsetsResult.ListOffsetsResultInfo> handleResponse(org.apache.kafka.common.Node broker, Set<org.apache.kafka.common.TopicPartition> keys, org.apache.kafka.common.requests.AbstractResponse abstractResponse) Description copied from interface:AdminApiHandlerCallback that is invoked when a request returns successfully. The handler should parse the response, check for errors, and return a result which indicates which keys (if any) have either been completed or failed with an unrecoverable error. It is also possible that the response indicates an incorrect target brokerId (e.g. in the case of a NotLeader error when the request is bound for a partition leader). In this case the key will be "unmapped" from the target brokerId and lookup will be retried. Note that keys which received a retriable error should be left out of the result. They will be retried automatically.- Parameters:
broker- the broker that the associated request was sent tokeys- the set of keys from the associated requestabstractResponse- the response received from the broker- Returns:
- result indicating key completion, failure, and unmapping
-
handleUnsupportedVersionException
public Map<org.apache.kafka.common.TopicPartition,Throwable> handleUnsupportedVersionException(int brokerId, org.apache.kafka.common.errors.UnsupportedVersionException exception, Set<org.apache.kafka.common.TopicPartition> keys) Description copied from interface:AdminApiHandlerCallback that is invoked when a fulfillment request hits an UnsupportedVersionException. Keys for which the exception cannot be handled and the request shouldn't be retried must be mapped to an error and returned. The request will then be retried for the remainder of the keys.- Returns:
- The failure mappings for the keys for which the exception cannot be handled and the request shouldn't be retried. If the exception cannot be handled all initial keys will be in the returned map.
-
newFuture
public static AdminApiFuture.SimpleAdminApiFuture<org.apache.kafka.common.TopicPartition,ListOffsetsResult.ListOffsetsResultInfo> newFuture(Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
-