kpatelatwork commented on a change in pull request #10822:
URL: https://github.com/apache/kafka/pull/10822#discussion_r656348082



##########
File path: 
connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java
##########
@@ -208,6 +209,21 @@ public static String COMMIT_TASKS_KEY(String 
connectorName) {
             .field("creation-timestamp", Schema.INT64_SCHEMA)
             .build();
 
+    public static final String RESTART_PREFIX = "restart-connector-";
+
+    public static String RESTART_KEY(String connectorName) {
+        return RESTART_PREFIX + connectorName;
+    }
+
+    public static final Boolean ONLY_FAILED_DEFAULT = Boolean.FALSE;
+    public static final Boolean INCLUDE_TASKS_DEFAULT = Boolean.FALSE;

Review comment:
       The defaults are used in code like below and using primitive would lead 
to an extra boxing
   
   >         Object failed = valueAsMap.get(ONLY_FAILED_FIELD_NAME);
   >         if (failed == null) {
   >             log.warn("Invalid data for restart request '{}' field was 
missing, defaulting to {}", ONLY_FAILED_FIELD_NAME, ONLY_FAILED_DEFAULT);
   >             failed = ONLY_FAILED_DEFAULT;
   >         }
   >         if (!(failed instanceof Boolean)) {
   >             log.warn("Invalid data for restart request '{}' field should 
be a Boolean but is {}, defaulting to {}", ONLY_FAILED_FIELD_NAME, 
failed.getClass(), ONLY_FAILED_DEFAULT);
   >             failed = ONLY_FAILED_DEFAULT;
   >         }
   >         boolean onlyFailed = (Boolean) failed;




-- 
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.

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


Reply via email to