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

[GitHub] [kafka] hudeqi opened a new pull request, #13617: MINOR:code optimization in QuorumController

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

   1. add hint in switch item "BROKER_LOGGER" in ConfigResourceExistenceChecker, otherwise, it will be classified as default break and deleted directly. I don’t know if adding hint is better than deleting directly.
   2. The ”generateSnapshotScheduled“ member variable in QuorumController is given a default value but has never been used. Is it better to change it to a final type and give a default value during initialization?
   


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


[GitHub] [kafka] hudeqi commented on pull request #13617: MINOR:code optimization in QuorumController

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

   Too many invalid commits, re-submit another


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


[GitHub] [kafka] hudeqi commented on a diff in pull request #13617: MINOR:code optimization in QuorumController

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


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1635,7 +1636,7 @@ private enum ImbalanceSchedule {
     /**
      * Tracks if a snapshot generate was scheduled.
      */
-    private boolean generateSnapshotScheduled = false;
+    private final boolean generateSnapshotScheduled;

Review Comment:
   It seems that this variable has been deleted in # 13540 and can be directly ignored...



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


[GitHub] [kafka] hudeqi commented on a diff in pull request #13617: MINOR:code optimization in QuorumController

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


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1635,7 +1636,7 @@ private enum ImbalanceSchedule {
     /**
      * Tracks if a snapshot generate was scheduled.
      */
-    private boolean generateSnapshotScheduled = false;
+    private final boolean generateSnapshotScheduled;

Review Comment:
   > If the value is always set to `false`, why have the variable at all? 🤔
   
   Hi, I also want to directly delete this variable because it has not been used anywhere, but I am not sure if this variable will be used in subsequent iteration development.



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


[GitHub] [kafka] hudeqi closed pull request #13617: MINOR:code optimization in QuorumController

Posted by "hudeqi (via GitHub)" <gi...@apache.org>.
hudeqi closed pull request #13617: MINOR:code optimization in QuorumController
URL: https://github.com/apache/kafka/pull/13617


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


[GitHub] [kafka] kirktrue commented on a diff in pull request #13617: MINOR:code optimization in QuorumController

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


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1635,7 +1636,7 @@ private enum ImbalanceSchedule {
     /**
      * Tracks if a snapshot generate was scheduled.
      */
-    private boolean generateSnapshotScheduled = false;
+    private final boolean generateSnapshotScheduled;

Review Comment:
   If the value is always set to `false`, why have the variable at all? 🤔



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


[GitHub] [kafka] hudeqi commented on a diff in pull request #13617: MINOR:code optimization in QuorumController

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


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1635,7 +1636,7 @@ private enum ImbalanceSchedule {
     /**
      * Tracks if a snapshot generate was scheduled.
      */
-    private boolean generateSnapshotScheduled = false;
+    private final boolean generateSnapshotScheduled;

Review Comment:
   > If the value is always set to `false`, why have the variable at all? 🤔
   
   Hi, I also want to directly delete this variable because it has not been used anywhere, but I am not sure if this variable will be used in subsequent iteration development. @kirktrue 



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


[GitHub] [kafka] hudeqi commented on pull request #13617: MINOR:code optimization in QuorumController

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

   Hello, Guozhang, please review if you have time. @guozhangwang 


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