You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "Mmuzaf (via GitHub)" <gi...@apache.org> on 2026/06/09 10:34:51 UTC
[PR] Speed up nodetool documentation generation by producing all command help in a single jvm [cassandra]
Mmuzaf opened a new pull request, #4874:
URL: https://github.com/apache/cassandra/pull/4874
patch by Maxim Muzafarov, reviewed by <> for CASSANDRA-21444
Thanks for sending a pull request! Here are some tips if you're new here:
* Ensure you have added or run the [appropriate tests](https://cassandra.apache.org/_/development/testing.html) for your PR.
* Be sure to keep the PR description updated to reflect all changes.
* Write your PR title to summarize what this PR proposes.
* If possible, provide a concise example to reproduce the issue for a faster review.
* Read our [contributor guidelines](https://cassandra.apache.org/_/development/index.html)
* If you're making a documentation change, see our [guide to documentation contribution](https://cassandra.apache.org/_/development/documentation.html)
Commit messages should follow the following format:
```
<One sentence description, usually Jira title or CHANGES.txt summary>
<Optional lengthier description (context on patch)>
patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####
Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>
```
The [Cassandra Jira](https://issues.apache.org/jira/projects/CASSANDRA/issues/)
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Speed up nodetool documentation generation by producing all command help in a single jvm [CASSANDRA-21444] [cassandra]
Posted by "Mmuzaf (via GitHub)" <gi...@apache.org>.
Mmuzaf commented on code in PR #4874:
URL: https://github.com/apache/cassandra/pull/4874#discussion_r3434688995
##########
test/unit/org/apache/cassandra/tools/nodetool/NodetoolHelpGenerator.java:
##########
@@ -137,11 +166,30 @@ public void writer(List<String> fullCommand)
}
}
- private static List<String> find(Supplier<ToolRunner.ToolResult> cmdResult, String afterLine, Pattern commandPattern)
+ private static String help(List<String> command)
+ {
+ List<String> args = new ArrayList<>();
+ if (!command.isEmpty())
+ {
+ args.add("help");
+ args.addAll(command);
+ }
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ PrintStream outStream = new PrintStream(out, true, StandardCharsets.UTF_8);
+ PrintStream errStream = new PrintStream(err, true, StandardCharsets.UTF_8);
+ int rc = new NodeTool(NO_PROBE, new Output(outStream, errStream)).execute(args.toArray(new String[0]));
+ outStream.flush();
+ errStream.flush();
+ if (rc != 0)
Review Comment:
Fixed.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Speed up nodetool documentation generation by producing all command help in a single jvm [CASSANDRA-21444] [cassandra]
Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on code in PR #4874:
URL: https://github.com/apache/cassandra/pull/4874#discussion_r3434391849
##########
test/unit/org/apache/cassandra/tools/nodetool/NodetoolHelpGenerator.java:
##########
@@ -137,11 +166,30 @@ public void writer(List<String> fullCommand)
}
}
- private static List<String> find(Supplier<ToolRunner.ToolResult> cmdResult, String afterLine, Pattern commandPattern)
+ private static String help(List<String> command)
+ {
+ List<String> args = new ArrayList<>();
+ if (!command.isEmpty())
+ {
+ args.add("help");
+ args.addAll(command);
+ }
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ PrintStream outStream = new PrintStream(out, true, StandardCharsets.UTF_8);
+ PrintStream errStream = new PrintStream(err, true, StandardCharsets.UTF_8);
+ int rc = new NodeTool(NO_PROBE, new Output(outStream, errStream)).execute(args.toArray(new String[0]));
+ outStream.flush();
+ errStream.flush();
+ if (rc != 0)
Review Comment:
should we also check if there are errors in stderr?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Speed up nodetool documentation generation by producing all command help in a single jvm [CASSANDRA-21444] [cassandra]
Posted by "Mmuzaf (via GitHub)" <gi...@apache.org>.
Mmuzaf closed pull request #4874: Speed up nodetool documentation generation by producing all command help in a single jvm [CASSANDRA-21444]
URL: https://github.com/apache/cassandra/pull/4874
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Speed up nodetool documentation generation by producing all command help in a single jvm [CASSANDRA-21444] [cassandra]
Posted by "Mmuzaf (via GitHub)" <gi...@apache.org>.
Mmuzaf commented on PR #4874:
URL: https://github.com/apache/cassandra/pull/4874#issuecomment-4741008234
Merged: https://github.com/apache/cassandra/commit/7899b594b83f6825672e79df0a8bcd7f1a1d0787
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Speed up nodetool documentation generation by producing all command help in a single jvm [CASSANDRA-21444] [cassandra]
Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on code in PR #4874:
URL: https://github.com/apache/cassandra/pull/4874#discussion_r3434391849
##########
test/unit/org/apache/cassandra/tools/nodetool/NodetoolHelpGenerator.java:
##########
@@ -137,11 +166,30 @@ public void writer(List<String> fullCommand)
}
}
- private static List<String> find(Supplier<ToolRunner.ToolResult> cmdResult, String afterLine, Pattern commandPattern)
+ private static String help(List<String> command)
+ {
+ List<String> args = new ArrayList<>();
+ if (!command.isEmpty())
+ {
+ args.add("help");
+ args.addAll(command);
+ }
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ PrintStream outStream = new PrintStream(out, true, StandardCharsets.UTF_8);
+ PrintStream errStream = new PrintStream(err, true, StandardCharsets.UTF_8);
+ int rc = new NodeTool(NO_PROBE, new Output(outStream, errStream)).execute(args.toArray(new String[0]));
+ outStream.flush();
+ errStream.flush();
+ if (rc != 0)
Review Comment:
should we also check if there are errors in stderr? (as we did before in assertOnCleanExit)
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org