Class AdminApiHandler.Batched<K,V>
java.lang.Object
org.apache.kafka.clients.admin.internals.AdminApiHandler.Batched<K,V>
- All Implemented Interfaces:
AdminApiHandler<K,V>
- Direct Known Subclasses:
AbortTransactionHandler,AlterConsumerGroupOffsetsHandler,DeleteConsumerGroupOffsetsHandler,DeleteConsumerGroupsHandler,DeleteRecordsHandler,DescribeConsumerGroupsHandler,DescribeProducersHandler,DescribeTransactionsHandler,ListOffsetsHandler,ListTransactionsHandler,RemoveMembersFromConsumerGroupHandler
- Enclosing interface:
AdminApiHandler<K,V>
public abstract static class AdminApiHandler.Batched<K,V>
extends Object
implements AdminApiHandler<K,V>
An
AdminApiHandler that will group multiple keys into a single request when possible.
Keys will be grouped together whenever they target the same broker. This type of handler
should be used when interacting with broker APIs that can act on multiple keys at once, such
as describing or listing transactions.-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildRequest(int brokerId, Set<K> keys) Build the requests necessary for the given keys.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.clients.admin.internals.AdminApiHandler
apiName, handleResponse, handleUnsupportedVersionException, lookupStrategy
-
Constructor Details
-
Batched
public Batched()
-
-
Method Details
-
buildRequest
Description copied from interface:AdminApiHandlerBuild the requests necessary for the given keys. The set of keys is derived byAdminApiDriverduring the lookup stage as the set of keys which all map to the same destination broker. Handlers can choose to issue a single request for all of the provided keys (seeAdminApiHandler.Batched, issue one request per key (seeAdminApiHandler.Unbatched, or implement their own custom grouping logic if necessary.- Specified by:
buildRequestin interfaceAdminApiHandler<K,V> - Parameters:
brokerId- the target brokerId for the requestkeys- the set of keys that should be handled by this request- Returns:
- a collection of
AdminApiHandler.RequestAndKeysfor the requests containing the given keys
-