init(daemonize, pidFile, quiet, env); } catch (NodeValidationException e) { throw new UserException(ExitCodes.CONFIG, e.getMessage());
messages.add("[" + (i + 1) + "]: " + errors.get(i)); final NodeValidationException ne = new NodeValidationException(String.join("\n", messages)); errors.stream().map(IllegalStateException::new).forEach(ne::addSuppressed); throw ne;
/** * Start a closed node. * * @param i * @return true if the node is started. */ @SuppressWarnings("resource") public boolean startNode(final int i) { if (i >= nodeList.size()) { return false; } if (!nodeList.get(i).isClosed()) { return false; } final Node node = new ClusterRunnerNode(settingsList.get(i), pluginList); try { node.start(); nodeList.set(i, node); return true; } catch (final NodeValidationException e) { print(e.getLocalizedMessage()); } return false; }
throw new NuxeoException("Cannot start embedded Elasticsearch: " + e.getMessage(), e); } catch (Exception e) { Throwable cause = ExceptionUtils.getRootCause(e);
messages.add("[" + (i + 1) + "]: " + errors.get(i)); final NodeValidationException ne = new NodeValidationException(String.join("\n", messages)); errors.stream().map(IllegalStateException::new).forEach(ne::addSuppressed); throw ne;
init(daemonize, pidFile, quiet, env); } catch (NodeValidationException e) { throw new UserException(ExitCodes.CONFIG, e.getMessage());
messages.add("[" + (i + 1) + "]: " + errors.get(i)); final NodeValidationException ne = new NodeValidationException(String.join("\n", messages)); errors.stream().map(IllegalStateException::new).forEach(ne::addSuppressed); throw ne;
init(daemonize, pidFile, quiet, env); } catch (NodeValidationException e) { throw new UserException(ExitCodes.CONFIG, e.getMessage());
messages.add("[" + (i + 1) + "]: " + errors.get(i)); final NodeValidationException ne = new NodeValidationException(String.join("\n", messages)); errors.stream().map(IllegalStateException::new).forEach(ne::addSuppressed); throw ne;
@Override protected void execute(Terminal terminal, OptionSet options, Environment env) throws UserException { if (options.nonOptionArguments().isEmpty() == false) { throw new UserException(ExitCodes.USAGE, "Positional arguments not allowed, found " + options.nonOptionArguments()); } if (options.has(versionOption)) { if (options.has(daemonizeOption) || options.has(pidfileOption)) { throw new UserException(ExitCodes.USAGE, "Elasticsearch version option is mutually exclusive with any other option"); } terminal.println("Version: " + org.elasticsearch.Version.CURRENT + ", Build: " + Build.CURRENT.shortHash() + "/" + Build.CURRENT.date() + ", JVM: " + JvmInfo.jvmInfo().version()); return; } final boolean daemonize = options.has(daemonizeOption); final Path pidFile = pidfileOption.value(options); final boolean quiet = options.has(quietOption); try { init(daemonize, pidFile, quiet, env); } catch (NodeValidationException e) { throw new UserException(ExitCodes.CONFIG, e.getMessage()); } }