Tabnine Logo
CommonUtils.exitWithError
Code IndexAdd Tabnine to your IDE (free)

How to use
exitWithError
method
in
com.hazelcast.simulator.utils.CommonUtils

Best Java code snippets using com.hazelcast.simulator.utils.CommonUtils.exitWithError (Showing top 15 results out of 315)

origin: com.hazelcast.simulator/simulator

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();
}
origin: com.hazelcast.simulator/simulator

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;
}
origin: com.hazelcast.simulator/simulator

  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);
    }
  }
}
origin: com.hazelcast.simulator/simulator

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);
  }
}
origin: com.hazelcast.simulator/simulator

public static void main(String[] args) {
  try {
    run(init(args));
  } catch (Exception e) {
    exitWithError(LOGGER, "Could not create heatmap!", e);
  }
}
origin: com.hazelcast.simulator/simulator

public static void main(String[] args) {
  try {
    run(args, init(args));
  } catch (Exception e) {
    exitWithError(LOGGER, "Could not provision machines", e);
  }
}
origin: com.hazelcast.simulator/simulator

  public static void main(String[] args) {
    try {
      HarakiriMonitorCli cli = new HarakiriMonitorCli(args);
      cli.run();
    } catch (Exception e) {
      exitWithError(LOGGER, "Could not start HarakiriMonitor!", e);
    }
  }
}
origin: com.hazelcast.simulator/simulator

  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);
    }
  }
}
origin: com.hazelcast.simulator/utils

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);
  }
}
origin: com.hazelcast.simulator/simulator

  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);
    }
  }
}
origin: com.hazelcast.simulator/simulator

        " [-listtags]                 list all tags found on histogram lines the input file."
);
exitWithError();
origin: com.hazelcast.simulator/simulator

  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);
    }
  }
}
origin: com.hazelcast.simulator/simulator

  exitWithError();
} else {
  if (LOGGER.isDebugEnabled()) {
origin: com.hazelcast.simulator/simulator

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);
  }
}
origin: com.hazelcast.simulator/tests-common

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);
  }
}
com.hazelcast.simulator.utilsCommonUtilsexitWithError

Popular methods of CommonUtils

  • sleepMillis
  • sleepSeconds
  • closeQuietly
  • exit
  • rethrow
  • sleepMillisThrowException
  • sleepNanos
  • throwableToString
  • await
  • awaitTermination
  • getElapsedSeconds
  • getSimulatorVersion
  • getElapsedSeconds,
  • getSimulatorVersion,
  • joinThread,
  • sleepRandomNanos,
  • sleepTimeUnit,
  • sleepUntilMs

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • JComboBox (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now