You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "justinmclean (via GitHub)" <gi...@apache.org> on 2025/01/22 03:31:27 UTC
[PR] [#6326] Refactor to add a command context [gravitino]
justinmclean opened a new pull request, #6343:
URL: https://github.com/apache/gravitino/pull/6343
### What changes were proposed in this pull request?
Refactor to add a command context and simple wrappers on output to make it easy for "global" command like a "--quiet" option to be added.
Note this in progress as this only has changed Metlake. Some duplicate code can be removed once everything is done.
### Why are the changes needed?
For maintainability.
Fix: #6326
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Tested locally.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6326] Refactor to add a command context to CLI [gravitino]
Posted by "shaofengshi (via GitHub)" <gi...@apache.org>.
shaofengshi commented on PR #6343:
URL: https://github.com/apache/gravitino/pull/6343#issuecomment-2642443391
Once the CI passed, it can be merged I think.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6326] Refactor to add a command context [gravitino]
Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on PR #6343:
URL: https://github.com/apache/gravitino/pull/6343#issuecomment-2638779365
@shaofengshi can you please review this when you have time - you may need to look at the conversation in other related PRs.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6326] Refactor to add a command context to CLI [gravitino]
Posted by "shaofengshi (via GitHub)" <gi...@apache.org>.
shaofengshi merged PR #6343:
URL: https://github.com/apache/gravitino/pull/6343
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6326] Refactor to add a command context to CLI [gravitino]
Posted by "shaofengshi (via GitHub)" <gi...@apache.org>.
shaofengshi commented on code in PR #6343:
URL: https://github.com/apache/gravitino/pull/6343#discussion_r1946249403
##########
clients/cli/src/main/java/org/apache/gravitino/cli/MetalakeCommandHandler.java:
##########
@@ -40,15 +39,18 @@ public class MetalakeCommandHandler extends CommandHandler {
* @param gravitinoCommandLine The Gravitino command line instance.
* @param line The command line arguments.
* @param command The command to execute.
- * @param ignore Ignore server version mismatch.
+ * @param context The command context.
*/
public MetalakeCommandHandler(
- GravitinoCommandLine gravitinoCommandLine, CommandLine line, String command, boolean ignore) {
+ GravitinoCommandLine gravitinoCommandLine,
+ CommandLine line,
+ String command,
+ CommandContext context) {
this.gravitinoCommandLine = gravitinoCommandLine;
this.line = line;
this.command = command;
- this.ignore = ignore;
- this.url = getUrl(line);
+ this.context = context;
+ this.context.setUrl(getUrl(line));
Review Comment:
OK, please refactor it later, as this will make the code clear.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6326] Refactor to add a command context to CLI [gravitino]
Posted by "shaofengshi (via GitHub)" <gi...@apache.org>.
shaofengshi commented on code in PR #6343:
URL: https://github.com/apache/gravitino/pull/6343#discussion_r1944389104
##########
clients/cli/src/main/java/org/apache/gravitino/cli/MetalakeCommandHandler.java:
##########
@@ -40,15 +39,18 @@ public class MetalakeCommandHandler extends CommandHandler {
* @param gravitinoCommandLine The Gravitino command line instance.
* @param line The command line arguments.
* @param command The command to execute.
- * @param ignore Ignore server version mismatch.
+ * @param context The command context.
*/
public MetalakeCommandHandler(
- GravitinoCommandLine gravitinoCommandLine, CommandLine line, String command, boolean ignore) {
+ GravitinoCommandLine gravitinoCommandLine,
+ CommandLine line,
+ String command,
+ CommandContext context) {
this.gravitinoCommandLine = gravitinoCommandLine;
this.line = line;
this.command = command;
- this.ignore = ignore;
- this.url = getUrl(line);
+ this.context = context;
+ this.context.setUrl(getUrl(line));
Review Comment:
The context object should be immutable. Is it possible to set the URL upon 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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6326] Refactor to add a command context to CLI [gravitino]
Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on code in PR #6343:
URL: https://github.com/apache/gravitino/pull/6343#discussion_r1945581200
##########
clients/cli/src/main/java/org/apache/gravitino/cli/MetalakeCommandHandler.java:
##########
@@ -40,15 +39,18 @@ public class MetalakeCommandHandler extends CommandHandler {
* @param gravitinoCommandLine The Gravitino command line instance.
* @param line The command line arguments.
* @param command The command to execute.
- * @param ignore Ignore server version mismatch.
+ * @param context The command context.
*/
public MetalakeCommandHandler(
- GravitinoCommandLine gravitinoCommandLine, CommandLine line, String command, boolean ignore) {
+ GravitinoCommandLine gravitinoCommandLine,
+ CommandLine line,
+ String command,
+ CommandContext context) {
this.gravitinoCommandLine = gravitinoCommandLine;
this.line = line;
this.command = command;
- this.ignore = ignore;
- this.url = getUrl(line);
+ this.context = context;
+ this.context.setUrl(getUrl(line));
Review Comment:
Currently, getUrl is part of CommandHandler, which is needed by the commands which have not been refactored yet. It might be possible to refactor after all commands have changed.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org