You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "mjsax (via GitHub)" <gi...@apache.org> on 2024/09/16 03:29:06 UTC

[PR] MINOR: fixing JavaDocs and other cleanup [kafka]

mjsax opened a new pull request, #17207:
URL: https://github.com/apache/kafka/pull/17207

   Thing IntelliJ highlighted...


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


Re: [PR] MINOR: fixing JavaDocs and other cleanup [kafka]

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on code in PR #17207:
URL: https://github.com/apache/kafka/pull/17207#discussion_r1760488991


##########
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:
##########
@@ -1452,7 +1456,7 @@ public CloseOptions leaveGroup(final boolean leaveGroup) {
      * This will block until all threads have stopped.
      */
     public void close() {
-        close(Long.MAX_VALUE, false);
+        close(Optional.empty(), false);

Review Comment:
   Changing this to `Optional` to unify the log message (cf other changes).



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


Re: [PR] MINOR: fixing JavaDocs and other cleanup [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17207:
URL: https://github.com/apache/kafka/pull/17207#discussion_r1763985609


##########
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:
##########
@@ -1531,7 +1535,15 @@ private Thread shutdownHelper(final boolean error, final long timeoutMs, final b
         }, clientId + "-CloseThread");
     }
 
-    private boolean close(final long timeoutMs, final boolean leaveGroup) {
+    private boolean close(final Optional<Long> timeout, final boolean leaveGroup) {
+        final long timeoutMs;
+        if (timeout.isPresent()) {
+            timeoutMs = timeout.get();
+            log.debug("Stopping Streams client with timeoutMillis = {} ms.", timeoutMs);

Review Comment:
   nit: there is "ms" already, so `timeoutMillis` could be simplified to `timeout`



##########
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java:
##########
@@ -1331,7 +1339,11 @@ public static String getString(final Map<String, Object> configs, final String k
             if (value instanceof String) {
                 return (String) value;
             } else {
-                log.warn("Invalid value (" + value + ") on internal configuration '" + key + "'. Please specify a String value.");

Review Comment:
   ditto



##########
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java:
##########
@@ -1321,7 +1325,11 @@ public static long getLong(final Map<String, Object> configs, final String key,
             } else if (value instanceof String) {
                 return Long.parseLong((String) value);
             } else {
-                log.warn("Invalid value (" + value + ") on internal configuration '" + key + "'. Please specify a numeric value.");
+                log.warn(String.format(

Review Comment:
   ditto



##########
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java:
##########
@@ -1309,7 +1309,11 @@ public static boolean getBoolean(final Map<String, Object> configs, final String
             } else if (value instanceof String) {
                 return Boolean.parseBoolean((String) value);
             } else {
-                log.warn("Invalid value (" + value + ") on internal configuration '" + key + "'. Please specify a true/false value.");
+                log.warn(String.format(

Review Comment:
   maybe we use placeholder?
   ```java
                   log.warn(
                       "Invalid value ({}) on internal configuration '{}}'. Please specify a true/false value.",
                       value,
                       key
                   );
   ```



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


Re: [PR] MINOR: fixing JavaDocs and other cleanup [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #17207:
URL: https://github.com/apache/kafka/pull/17207


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


Re: [PR] MINOR: fixing JavaDocs and other cleanup [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #17207:
URL: https://github.com/apache/kafka/pull/17207#issuecomment-2364791530

   @mjsax Could you please fix the conflicts?


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


Re: [PR] MINOR: fixing JavaDocs and other cleanup [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17207:
URL: https://github.com/apache/kafka/pull/17207#discussion_r1761356630


##########
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:
##########
@@ -539,9 +539,12 @@ private void handleStreamsUncaughtException(final Throwable throwable,
                 }
                 break;
             case SHUTDOWN_CLIENT:
-                log.error("Encountered the following exception during processing " +
-                        "and the registered exception handler opted to " + action + "." +
-                        " The streams client is going to shut down now. ", throwable);
+                log.error(String.format(
+                    "Encountered the following exception during processing and the registered exception handler" +

Review Comment:
   Pardon me, why not using `{}` placeholder directly?



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