gabriellefu commented on code in PR #23165:
URL: https://github.com/apache/kafka/pull/23165#discussion_r4210253136
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/assignor/AssignmentConfigsImpl.java:
##########
@@ -52,22 +54,28 @@ public record AssignmentConfigsImpl(
}
/**
- * Converts the raw assignment configs computed for the group into the
typed configs passed to the assignor.
+ * Converts the assignment configs recorded for the group into the typed
configs passed to the assignor.
+ *
+ * @param configs The configs from the group metadata record, or null if
the record has none.
*/
- public static AssignmentConfigsImpl fromMap(Map<String, String> configs) {
- // The map is empty when it was replayed from a group metadata record
written before the last assignment
- // configs were persisted.
- if (configs.isEmpty()) {
+ public static AssignmentConfigsImpl
fromRecord(List<StreamsGroupMetadataValue.LastAssignmentConfig> configs) {
+ // If a config is not present, we use its default value. A record
written before the configs were persisted has
+ // none, and a config added later is only written when it is not at
its default.
+ if (configs == null) {
return DEFAULT;
}
- // The rack-aware assignment tags are only recorded when any are
configured, so an absent value means the
- // configuration is at its default.
- String rackAwareAssignmentTags = configs.getOrDefault(
- RACK_AWARE_ASSIGNMENT_TAGS_CONFIG,
GroupCoordinatorConfig.STREAMS_GROUP_RACK_AWARE_ASSIGNMENT_TAGS_DEFAULT);
- return new AssignmentConfigsImpl(
- Integer.parseInt(configs.get(NUM_STANDBY_REPLICAS_CONFIG)),
- parseRackAwareAssignmentTags(rackAwareAssignmentTags)
- );
+ int numStandbyReplicas = DEFAULT.numStandbyReplicas();
Review Comment:
thanks for the suggestion, i will make some more investigation on this and
maybe open a follow up pr under this ticket
https://issues.apache.org/jira/browse/KAFKA-20896
--
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]