Search in sources :

Example 1 with CoordinatorKey

use of org.apache.kafka.clients.admin.internals.CoordinatorKey in project kafka by apache.

the class KafkaAdminClient method alterConsumerGroupOffsets.

@Override
public AlterConsumerGroupOffsetsResult alterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, AlterConsumerGroupOffsetsOptions options) {
    SimpleAdminApiFuture<CoordinatorKey, Map<TopicPartition, Errors>> future = AlterConsumerGroupOffsetsHandler.newFuture(groupId);
    AlterConsumerGroupOffsetsHandler handler = new AlterConsumerGroupOffsetsHandler(groupId, offsets, logContext);
    invokeDriver(handler, future, options.timeoutMs);
    return new AlterConsumerGroupOffsetsResult(future.get(CoordinatorKey.byGroupId(groupId)));
}
Also used : CoordinatorKey(org.apache.kafka.clients.admin.internals.CoordinatorKey) Map(java.util.Map) TreeMap(java.util.TreeMap) HashMap(java.util.HashMap) AlterConsumerGroupOffsetsHandler(org.apache.kafka.clients.admin.internals.AlterConsumerGroupOffsetsHandler)

Example 2 with CoordinatorKey

use of org.apache.kafka.clients.admin.internals.CoordinatorKey in project kafka by apache.

the class KafkaAdminClient method describeTransactions.

@Override
public DescribeTransactionsResult describeTransactions(Collection<String> transactionalIds, DescribeTransactionsOptions options) {
    AdminApiFuture.SimpleAdminApiFuture<CoordinatorKey, TransactionDescription> future = DescribeTransactionsHandler.newFuture(transactionalIds);
    DescribeTransactionsHandler handler = new DescribeTransactionsHandler(logContext);
    invokeDriver(handler, future, options.timeoutMs);
    return new DescribeTransactionsResult(future.all());
}
Also used : CoordinatorKey(org.apache.kafka.clients.admin.internals.CoordinatorKey) AdminApiFuture(org.apache.kafka.clients.admin.internals.AdminApiFuture) SimpleAdminApiFuture(org.apache.kafka.clients.admin.internals.AdminApiFuture.SimpleAdminApiFuture) DescribeTransactionsHandler(org.apache.kafka.clients.admin.internals.DescribeTransactionsHandler)

Example 3 with CoordinatorKey

use of org.apache.kafka.clients.admin.internals.CoordinatorKey in project kafka by apache.

the class KafkaAdminClient method describeConsumerGroups.

@Override
public DescribeConsumerGroupsResult describeConsumerGroups(final Collection<String> groupIds, final DescribeConsumerGroupsOptions options) {
    SimpleAdminApiFuture<CoordinatorKey, ConsumerGroupDescription> future = DescribeConsumerGroupsHandler.newFuture(groupIds);
    DescribeConsumerGroupsHandler handler = new DescribeConsumerGroupsHandler(options.includeAuthorizedOperations(), logContext);
    invokeDriver(handler, future, options.timeoutMs);
    return new DescribeConsumerGroupsResult(future.all().entrySet().stream().collect(Collectors.toMap(entry -> entry.getKey().idValue, Map.Entry::getValue)));
}
Also used : CoordinatorKey(org.apache.kafka.clients.admin.internals.CoordinatorKey) DescribeConsumerGroupsHandler(org.apache.kafka.clients.admin.internals.DescribeConsumerGroupsHandler)

Example 4 with CoordinatorKey

use of org.apache.kafka.clients.admin.internals.CoordinatorKey in project kafka by apache.

the class KafkaAdminClient method listConsumerGroupOffsets.

@Override
public ListConsumerGroupOffsetsResult listConsumerGroupOffsets(final String groupId, final ListConsumerGroupOffsetsOptions options) {
    SimpleAdminApiFuture<CoordinatorKey, Map<TopicPartition, OffsetAndMetadata>> future = ListConsumerGroupOffsetsHandler.newFuture(groupId);
    ListConsumerGroupOffsetsHandler handler = new ListConsumerGroupOffsetsHandler(groupId, options.topicPartitions(), logContext);
    invokeDriver(handler, future, options.timeoutMs);
    return new ListConsumerGroupOffsetsResult(future.get(CoordinatorKey.byGroupId(groupId)));
}
Also used : CoordinatorKey(org.apache.kafka.clients.admin.internals.CoordinatorKey) ListConsumerGroupOffsetsHandler(org.apache.kafka.clients.admin.internals.ListConsumerGroupOffsetsHandler) Map(java.util.Map) TreeMap(java.util.TreeMap) HashMap(java.util.HashMap)

Example 5 with CoordinatorKey

use of org.apache.kafka.clients.admin.internals.CoordinatorKey in project kafka by apache.

the class KafkaAdminClient method deleteConsumerGroupOffsets.

@Override
public DeleteConsumerGroupOffsetsResult deleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions, DeleteConsumerGroupOffsetsOptions options) {
    SimpleAdminApiFuture<CoordinatorKey, Map<TopicPartition, Errors>> future = DeleteConsumerGroupOffsetsHandler.newFuture(groupId);
    DeleteConsumerGroupOffsetsHandler handler = new DeleteConsumerGroupOffsetsHandler(groupId, partitions, logContext);
    invokeDriver(handler, future, options.timeoutMs);
    return new DeleteConsumerGroupOffsetsResult(future.get(CoordinatorKey.byGroupId(groupId)), partitions);
}
Also used : CoordinatorKey(org.apache.kafka.clients.admin.internals.CoordinatorKey) DeleteConsumerGroupOffsetsHandler(org.apache.kafka.clients.admin.internals.DeleteConsumerGroupOffsetsHandler) Map(java.util.Map) TreeMap(java.util.TreeMap) HashMap(java.util.HashMap)

Aggregations

CoordinatorKey (org.apache.kafka.clients.admin.internals.CoordinatorKey)8 HashMap (java.util.HashMap)4 Map (java.util.Map)4 TreeMap (java.util.TreeMap)4 AdminApiFuture (org.apache.kafka.clients.admin.internals.AdminApiFuture)1 SimpleAdminApiFuture (org.apache.kafka.clients.admin.internals.AdminApiFuture.SimpleAdminApiFuture)1 AlterConsumerGroupOffsetsHandler (org.apache.kafka.clients.admin.internals.AlterConsumerGroupOffsetsHandler)1 DeleteConsumerGroupOffsetsHandler (org.apache.kafka.clients.admin.internals.DeleteConsumerGroupOffsetsHandler)1 DeleteConsumerGroupsHandler (org.apache.kafka.clients.admin.internals.DeleteConsumerGroupsHandler)1 DescribeConsumerGroupsHandler (org.apache.kafka.clients.admin.internals.DescribeConsumerGroupsHandler)1 DescribeTransactionsHandler (org.apache.kafka.clients.admin.internals.DescribeTransactionsHandler)1 ListConsumerGroupOffsetsHandler (org.apache.kafka.clients.admin.internals.ListConsumerGroupOffsetsHandler)1 RemoveMembersFromConsumerGroupHandler (org.apache.kafka.clients.admin.internals.RemoveMembersFromConsumerGroupHandler)1 MemberIdentity (org.apache.kafka.common.message.LeaveGroupRequestData.MemberIdentity)1