Interface GroupSpec
public interface GroupSpec
The group metadata specifications required to compute the target assignment.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isPartitionAssignable
(Uuid topicId, int partitionId) For share groups, a partition can only be assigned once its initialization is complete.boolean
isPartitionAssigned
(Uuid topicId, int partitionId) Determine whether a topic id and partition have been assigned to a member.memberAssignment
(String memberId) Gets the current assignment of the member.memberSubscription
(String memberId) Gets the member subscription specification for a member.
-
Method Details
-
memberIds
Collection<String> memberIds()- Returns:
- All the member Ids of the consumer group.
-
subscriptionType
SubscriptionType subscriptionType()- Returns:
- The group's subscription type.
-
isPartitionAssigned
Determine whether a topic id and partition have been assigned to a member. This method functions the same for all types of groups.- Parameters:
topicId
- Uuid corresponding to the partition's topic.partitionId
- Partition Id within topic.- Returns:
- True, if the partition is currently assigned to a member. False, otherwise.
-
isPartitionAssignable
For share groups, a partition can only be assigned once its initialization is complete. For other group types, this initialization is not required and all partitions returned by the SubscribedTopicDescriber are always assignable.- Parameters:
topicId
- Uuid corresponding to the partition's topic.partitionId
- Partition Id within topic.- Returns:
- True, if the partition is assignable.
-
memberSubscription
Gets the member subscription specification for a member.- Parameters:
memberId
- The member Id.- Returns:
- The member's subscription metadata.
- Throws:
IllegalArgumentException
- If the member Id isn't found.
-
memberAssignment
Gets the current assignment of the member.- Parameters:
memberId
- The member Id.- Returns:
- The member's assignment or an empty assignment if the member does not have one.
-