chungen0126 commented on code in PR #10934:
URL: https://github.com/apache/ozone/pull/10934#discussion_r3725442977
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/OzoneLocal.java:
##########
@@ -197,13 +199,58 @@ static class RunCommand extends AbstractSubcommand
implements Callable<Void> {
public Void call() throws Exception {
LocalOzoneClusterConfig config = resolveConfig();
try (LocalOzoneRuntime runtime = createRuntime(config, getOzoneConf())) {
- runtime.start();
+ start(runtime);
printSummary(runtime, config);
awaitShutdown(runtime);
}
return null;
}
+ /**
+ * Starts {@code runtime}, restating a failure in a form the user can act
on. Service logs are
+ * off by default for this command, so the detail goes to the log for
{@code --loglevel INFO}
+ * while the message keeps {@link GenericCli}'s single-line path: an
exception with no message
+ * would otherwise print a raw stack trace.
+ */
+ private void start(LocalOzoneRuntime runtime) throws Exception {
+ try {
+ runtime.start();
+ } catch (Exception ex) {
+ LOG.error("Local Ozone cluster failed to start.", ex);
+ throw new IOException("Local Ozone failed to start: " +
failureMessage(ex)
+ + " Re-run with `ozone --loglevel INFO local run` for service
logs,"
+ + " or add --verbose for the full stack trace.", ex);
Review Comment:
I don't think we need the failureMessage extraction here. Since we are
already passing ex as the cause in new `IOException("...", ex)`.
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/LocalOzoneCluster.java:
##########
@@ -196,6 +201,7 @@ public final class LocalOzoneCluster implements
LocalOzoneRuntime {
private StorageContainerManager scm;
private OzoneManager om;
private final List<HddsDatanodeService> datanodes = new ArrayList<>();
+ private final List<String> discardedUserConfigKeys = new ArrayList<>();
Review Comment:
I am not entirely sure about the purpose of discardedUserConfigKeys. In my
opinion, if a user specifies a parameter and it's invalid/incompatible, we
should fail-fast and throw an error message, rather than silently modifying it.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]