lucasbru commented on code in PR #22245:
URL: https://github.com/apache/kafka/pull/22245#discussion_r3272769589
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroup.java:
##########
@@ -442,6 +442,16 @@ public StreamsGroupMember staticMember(String instanceId) {
return existingMemberId == null ? null :
getMemberOrThrow(existingMemberId);
}
+ /**
+ * Gets a dynamic member.
+ *
+ * @param memberId The Member ID.
+ * @return The member corresponding to the given member ID or null if it
does not exist
+ */
+ public StreamsGroupMember dynamicMember(String memberId) {
Review Comment:
this returns any member from the map, not just dynamic ones - the name and
javadoc are a bit misleading. Today only called when instanceId == null so it
works, but worth renaming or fixing the doc
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroup.java:
##########
@@ -524,13 +534,33 @@ public Map<String, String> staticMembers() {
return Collections.unmodifiableMap(staticMembers);
}
+ /**
+ * Returns true if the static member exists.
+ *
+ * @param instanceId The instance id.
+ *
+ * @return A boolean indicating whether the member exists or not.
+ */
+ public boolean hasStaticMember(String instanceId) {
+ if (instanceId == null) return false;
+ return staticMembers.containsKey(instanceId);
+ }
+
/**
* Returns the target assignment of the member.
*
* @return The StreamsGroupMemberAssignment or an EMPTY one if it does not
exist.
*/
- public TasksTuple targetAssignment(String memberId) {
- return targetAssignment.getOrDefault(memberId, TasksTuple.EMPTY);
+ public TasksTuple targetAssignment(String memberId, Optional<String>
instanceId) {
Review Comment:
javadoc wasn't updated for the new signature - missing @param entries and
the instanceId fallback through staticMembers isn't described
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]