You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "DomGarguilo (via GitHub)" <gi...@apache.org> on 2026/10/08 14:25:04 UTC

[PR] Avoid creating a new process just to set goal state in MAC [accumulo]

DomGarguilo opened a new pull request, #6582:
URL: https://github.com/apache/accumulo/pull/6582

   MAC start-up launched a separate JVM just to run `SetGoalState` and waited for it before starting the manager. This PR speeds things up by doing that ZK write directly from the existing test process using the server context already available.
   
   From some rough timing prints, the replaced goal state step went from ~1.6s -> ~0.25-0.7 seconds. Most ITs use this path so the time savings really add up over the coarse of a full build.


-- 
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: notifications-unsubscribe@accumulo.apache.org

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


Re: [PR] Avoid creating a new process just to set goal state in MAC [accumulo]

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #6582:
URL: https://github.com/apache/accumulo/pull/6582#discussion_r4231964332


##########
server/manager/src/main/java/org/apache/accumulo/manager/state/SetGoalState.java:
##########
@@ -38,13 +39,15 @@ public class SetGoalState {
    * Utility program that will change the goal state for the manager from the command line.
    */
   public static void main(String[] args) throws Exception {
+    final ManagerGoalState targetGoalState;
     try {
       Preconditions.checkArgument(args.length == 1);
-      ManagerGoalState.valueOf(args[0]);
+      targetGoalState = ManagerGoalState.valueOf(args[0]);
     } catch (IllegalArgumentException e) {
       System.err.println(
           "Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]");
       System.exit(-1);
+      return;

Review Comment:
   Yea. In 65f0dd8 I refactored to do `final ManagerGoalState targetGoalState;` so we can reuse that var instead of doing `args[0]`. Thought that was cleaner and more readable. Needed to add the return there since the compiler complains that the new final `targetGoalState` might not be initialized otherwise.



-- 
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: notifications-unsubscribe@accumulo.apache.org

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


Re: [PR] Avoid creating a new process just to set goal state in MAC [accumulo]

Posted by "ddanielr (via GitHub)" <gi...@apache.org>.
ddanielr commented on code in PR #6582:
URL: https://github.com/apache/accumulo/pull/6582#discussion_r4231917217


##########
server/manager/src/main/java/org/apache/accumulo/manager/state/SetGoalState.java:
##########
@@ -38,13 +39,15 @@ public class SetGoalState {
    * Utility program that will change the goal state for the manager from the command line.
    */
   public static void main(String[] args) throws Exception {
+    final ManagerGoalState targetGoalState;
     try {
       Preconditions.checkArgument(args.length == 1);
-      ManagerGoalState.valueOf(args[0]);
+      targetGoalState = ManagerGoalState.valueOf(args[0]);
     } catch (IllegalArgumentException e) {
       System.err.println(
           "Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]");
       System.exit(-1);
+      return;

Review Comment:
   I don't think this return will ever be reached due to the System.exit call above it.
   Was this added to silence ide warnings?



-- 
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: notifications-unsubscribe@accumulo.apache.org

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


Re: [PR] Avoid creating a new process just to set goal state in MAC [accumulo]

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on PR #6582:
URL: https://github.com/apache/accumulo/pull/6582#issuecomment-6084227724

   > To future-proof somewhat, you could also move the line of code in `SetGoalState.main()` into a `public static void` method that accepts a `ServerContext` and just call that method from here.
   
   Good idea. Refactored into a helper method in 65f0dd8


-- 
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: notifications-unsubscribe@accumulo.apache.org

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


Re: [PR] Avoid creating a new process just to set goal state in MAC [accumulo]

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


-- 
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: notifications-unsubscribe@accumulo.apache.org

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


Re: [PR] Avoid creating a new process just to set goal state in MAC [accumulo]

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #6582:
URL: https://github.com/apache/accumulo/pull/6582#discussion_r4231964332


##########
server/manager/src/main/java/org/apache/accumulo/manager/state/SetGoalState.java:
##########
@@ -38,13 +39,15 @@ public class SetGoalState {
    * Utility program that will change the goal state for the manager from the command line.
    */
   public static void main(String[] args) throws Exception {
+    final ManagerGoalState targetGoalState;
     try {
       Preconditions.checkArgument(args.length == 1);
-      ManagerGoalState.valueOf(args[0]);
+      targetGoalState = ManagerGoalState.valueOf(args[0]);
     } catch (IllegalArgumentException e) {
       System.err.println(
           "Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]");
       System.exit(-1);
+      return;

Review Comment:
   Yea. In 65f0dd8 I refactored to do `final ManagerGoalState targetGoalState;` so we can reuse that var instead of doing `args[0]` twice. Thought that was cleaner and more readable. Needed to add the return there since the compiler complains that the new final `targetGoalState` might not be initialized otherwise.



-- 
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: notifications-unsubscribe@accumulo.apache.org

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