You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "cadonna (via GitHub)" <gi...@apache.org> on 2023/08/14 15:44:00 UTC

[GitHub] [kafka] cadonna commented on a diff in pull request #14103: HOTIFX: fix Kafka Streams upgrade path from 3.4 to 3.5

cadonna commented on code in PR #14103:
URL: https://github.com/apache/kafka/pull/14103#discussion_r1293650475


##########
clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java:
##########
@@ -947,9 +947,15 @@ public String toString() {
     }
 
     public static class ValidString implements Validator {
-        final List<String> validStrings;
+        // visible for testing

Review Comment:
   You can use:
   ```java
   switch (StreamsConfig.UpgradeFromValues.valueOf((String) upgradeFrom)) {
       case UPGRADE_FROM_0100:
       ...
   
   ```
   
   Additionally, we can implement a validator that uses the enum to verify the values here:
   ```java
   .define(UPGRADE_FROM_CONFIG,
                       ConfigDef.Type.STRING,
                       null,
                       in(null,
                          UPGRADE_FROM_0100,
                          UPGRADE_FROM_0101,
                          UPGRADE_FROM_0102,
                          UPGRADE_FROM_0110,
                          UPGRADE_FROM_10,
                          UPGRADE_FROM_11,
                          UPGRADE_FROM_20,
                          UPGRADE_FROM_21,
                          UPGRADE_FROM_22,
                          UPGRADE_FROM_23,
                          UPGRADE_FROM_24,
                          UPGRADE_FROM_25,
                          UPGRADE_FROM_26,
                          UPGRADE_FROM_27,
                          UPGRADE_FROM_28,
                          UPGRADE_FROM_30,
                          UPGRADE_FROM_31,
                          UPGRADE_FROM_32,
                          UPGRADE_FROM_33,
                          UPGRADE_FROM_34),
                       Importance.LOW,
                       UPGRADE_FROM_DOC)
   ```
   So we do not need to maintain this list separately from the strings and enums.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org