private static void printHelpAndExit() { System.out.println( "Command Description \n" + "-------------------------- \n" + "download Downloads all artifacts from the workers \n" + "install Installs vendor software on the remote machines \n" + "print-layout Prints the cluster-layout \n" + "test-run Runs a test and wait for completion \n" + "test-start Starts a test asynchronously \n" + "test-stop Stops a test \n" + "test-status Checks the status of a test \n" + "stop Stops the Coordinator remote session \n" + "worker-kill Kills one or more workers \n" + "worker-script Executes a script on workers \n" + "worker-start Starts workers "); exitWithError(); }
private EncodableHistogram getIntervalHistogram() { EncodableHistogram histogram = null; try { histogram = logReader.nextIntervalHistogram(config.rangeStartTimeSec, config.rangeEndTimeSec); } catch (RuntimeException ex) { System.err.println("Log file parsing error at line number " + lineNumber + ": line appears to be malformed."); if (config.verbose) { throw ex; } else { exitWithError(); } } lineNumber++; return histogram; }
public static void main(String[] args) { try { AgentCli cli = new AgentCli(args); LOGGER.info(format("CloudIdentity: %s", cli.cloudIdentity)); LOGGER.info(format("CloudCredential: %s", cli.cloudCredential)); LOGGER.info(format("CloudProvider: %s", cli.cloudProvider)); Agent agent = cli.agent; agent.start(); } catch (Exception e) { exitWithError(LOGGER, "Could not start Agent!", e); } } }
public static void main(String[] args) throws Exception { CoordinatorRemoteCli cli = null; try { cli = new CoordinatorRemoteCli(args); cli.run(); } catch (Exception e) { System.err.print(e.getMessage()); exitWithError(LOGGER, e.getMessage(), e); } finally { closeQuietly(cli); } }
public static void main(String[] args) { try { run(init(args)); } catch (Exception e) { exitWithError(LOGGER, "Could not create heatmap!", e); } }
public static void main(String[] args) { try { run(args, init(args)); } catch (Exception e) { exitWithError(LOGGER, "Could not provision machines", e); } }
public static void main(String[] args) { try { HarakiriMonitorCli cli = new HarakiriMonitorCli(args); cli.run(); } catch (Exception e) { exitWithError(LOGGER, "Could not start HarakiriMonitor!", e); } } }
public static void main(String[] args) { LOGGER.info("Hazelcast Simulator Coordinator"); LOGGER.info(format("Version: %s, Commit: %s, Build Time: %s", getSimulatorVersion(), getCommitIdAbbrev(), getBuildTime())); LOGGER.info(format("SIMULATOR_HOME: %s", getSimulatorHome().getAbsolutePath())); try { CoordinatorCli cli = new CoordinatorCli(args); cli.run(); } catch (Exception e) { exitWithError(LOGGER, "Failed to run Coordinator", e); } } }
public static StringBuilder execute(String command) { StringBuilder sb = new StringBuilder(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Executing bash command: " + command); } try { // create a process for the shell ProcessBuilder pb = new ProcessBuilder("bash", "-c", command); pb = pb.redirectErrorStream(true); Process shell = pb.start(); new BashStreamGobbler(shell.getInputStream(), sb).start(); // wait for the shell to finish and get the return code int shellExitStatus = shell.waitFor(); if (shellExitStatus != 0) { LOGGER.error(format("Failed to execute [%s]", command)); LOGGER.error(sb.toString()); exitWithError(); } else { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Bash output: " + NEW_LINE + sb); } } return sb; } catch (Exception e) { throw rethrow(e); } }
public static void main(String[] args) { LOGGER.info("Hazelcast Simulator Provisioner"); LOGGER.info(format("Version: %s, Commit: %s, Build Time: %s", getSimulatorVersion(), getCommitIdAbbrev(), getBuildTime())); LOGGER.info(format("SIMULATOR_HOME: %s", getSimulatorHome())); try { ProvisionerCli cli = new ProvisionerCli(args); cli.run(); } catch (Exception e) { exitWithError(LOGGER, "Could not execute command", e); } } }
" [-listtags] list all tags found on histogram lines the input file." ); exitWithError();
public static void main(String[] args) { LOGGER.info("Hazelcast Simulator Wizard"); LOGGER.info(format("Version: %s, Commit: %s, Build Time: %s", getSimulatorVersion(), getCommitIdAbbrev(), getBuildTime())); try { WizardCli cli = new WizardCli(args); cli.run(); } catch (Exception e) { exitWithError(LOGGER, "Could not execute command", e); } } }
exitWithError(); } else { if (LOGGER.isDebugEnabled()) {
public static void main(String[] args) { int pid = NativeUtils.getPID(); LOGGER.info("PID: " + pid); writeText("" + pid, new File(getUserDir(), "worker.pid")); try { startWorker(); } catch (Exception e) { ExceptionReporter.report(null, e); exitWithError(LOGGER, "Could not start Hazelcast Simulator Worker!", e); } }
private void createFailure(TestPhase currentTestPhase) throws Exception { if (!isSelected || testPhase != currentTestPhase) { return; } switch (failure) { case EXCEPTION: handleThrowable(new TestException("Expected exception")); break; case ERROR: handleThrowable(new AssertionError("Expected error")); break; case NPE: handleThrowable(new NullPointerException("Expected NPE")); break; case FAIL: fail("Wanted failure"); break; case OOME: createOOME(); break; case EXIT: exitWithError(); break; default: throw new UnsupportedOperationException("Unknown failure: " + failure); } }