Skip to content

Conversation

@kgusakov
Copy link
Contributor

@kgusakov kgusakov commented Jun 1, 2021

No description provided.

return new Args(args[0], null);
else if (args.length == 3) {
if ("--config".equals(args[0]))
return new Args(args[2], Path.of(args[1]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be some validation? Path.of could throw at least IllegalArgumentException or FileSystemNotFoundException, should we catch such cases and rethrow ParseException?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed for InvalidPathException. Looks like other types of runtime exceptions are not relevant for catching here.

}
catch (Args.ParseException e) {
System.out.println(e.getMessage());
System.exit(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line. Also, should we write here some clarification what happened before e.getMessage()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's so tricky to improve the messaging for all types of issues without more complex argument parsing logic. I think that usage message + [some details] (for --config path parsing) is ok for current arguments. WDYT?

Anyway, error reporting updated, you can check the current aprroach.

public String name() throws IgniteInternalCheckedException {
synchronized (mux) {
try {
return new String(vaultService.get(NODE_NAME).get().value());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but should we consider some caching here? Seems that name() might be called frequently, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, not sure too :) appliedRevision can have the same issue, maybe we should fix it in the scope of another issue?

kgusakov and others added 2 commits June 7, 2021 14:03
…aultManager.java

Co-authored-by: Mirza Aliev <alievmirza@gmail.com>
@asfgit asfgit closed this in 44d69d3 Jun 7, 2021
asfgit pushed a commit that referenced this pull request Jun 7, 2021
Signed-off-by: Slava Koptilin <slava.koptilin@gmail.com>
(cherry picked from commit 44d69d3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants