Java Code Examples for org.apache.ratis.util.ExitUtils#terminate()

The following examples show how to use org.apache.ratis.util.ExitUtils#terminate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OzoneManagerStateMachine.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
/**
 * Terminate OM.
 * @param omResponse
 * @param resultCode
 */
private void terminate(OMResponse omResponse,
    OMException.ResultCodes resultCode) {
  OMException exception = new OMException(omResponse.getMessage(),
      resultCode);
  String errorMessage = "OM Ratis Server has received unrecoverable " +
      "error, to avoid further DB corruption, terminating OM. Error " +
      "Response received is:" + omResponse;
  ExitUtils.terminate(1, errorMessage, exception, LOG);
}
 
Example 2
Source File: OzoneManagerStateMachine.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
/**
 * Submits write request to OM and returns the response Message.
 * @param request OMRequest
 * @return response from OM
 * @throws ServiceException
 */
private OMResponse runCommand(OMRequest request, long trxLogIndex) {
  try {
    return handler.handleWriteRequest(request,
        trxLogIndex).getOMResponse();
  } catch (Throwable e) {
    // For any Runtime exceptions, terminate OM.
    String errorMessage = "Request " + request + "failed with exception";
    ExitUtils.terminate(1, errorMessage, e, LOG);
  }
  return null;
}
 
Example 3
Source File: OzoneManagerDoubleBuffer.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
private void terminate(IOException ex) {
  String message = "During flush to DB encountered error in " +
      "OMDoubleBuffer flush thread " + Thread.currentThread().getName();
  ExitUtils.terminate(1, message, ex, LOG);
}