Abyss-lord commented on PR #5836:
URL: https://github.com/apache/gravitino/pull/5836#issuecomment-2540408573
> That sounds like a better approach, and yes, checking metalake could give
a better error message.
@justinmclean @xunliu
hi guys, Please help to see if the code structure is reasonable.
```java
public void handle() {
if (!checkArguments){
return;
}
}
...
protected boolean checkArguments() {
// check arguments and show
// combine displayMissingArguments and hasCompleteArguments
}
```
For the create command, the entity to be created will be validated. For
example, the create metalake command will check the metalake parameter.
Additionally, it might be beneficial to further optimize the Command class
by calling `execute` instead of `handle`. This would allow the argument
checking logic to be moved up into the `Command` class itself, streamlining the
process.
```java
public void execute(){
// defined in Command class
if (!checkArguments){
return;
}
handle();
}
protected void handle() {
// remain unchanged
}
...
protected boolean checkArguments() {
// check arguments and show
// combine displayMissingArguments and hasCompleteArguments
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]