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>
  • 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

      public String apiName()
      Description copied from interface: AdminApiHandler
      Get a user-friendly name for the API this handler is implementing.
    • lookupStrategy

      public AdminApiLookupStrategy<org.apache.kafka.common.TopicPartition> lookupStrategy()
      Description copied from interface: AdminApiHandler
      Get 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: AdminApiHandler
      Callback 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 to
      keys - the set of keys from the associated request
      abstractResponse - 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: AdminApiHandler
      Callback 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)