private void die(Throwable exception) { String processInfo = _process.getProcessInfoString() + _process.getProcessTerminationInfoString(); _exception = new RuntimeException(processInfo, exception); String message = String.format("Halting process: ShellBolt died. Command: %s, ProcessInfo %s", Arrays.toString(_command), processInfo); LOG.error(message, exception); _collector.reportError(exception); if (!_isLocalMode && (_running || (exception instanceof Error))) { //don't exit if not running, unless it is an Error System.exit(11); } }
private void die(Throwable exception) { String processInfo = _process.getProcessInfoString() + _process.getProcessTerminationInfoString(); _exception = new RuntimeException(processInfo, exception); String message = String.format("Halting process: ShellSpout died. Command: %s, ProcessInfo %s", Arrays.toString(_command), processInfo); LOG.error(message, exception); _collector.reportError(exception); if (_running || (exception instanceof Error)) { //don't exit if not running, unless it is an Error System.exit(11); } }
private ShellProcess mockProcess() { ShellProcess process = mock(ShellProcess.class); when(process.getProcessInfoString()).thenReturn("info"); return process; }
msg = "ShellLog " + msg; } else { msg = "ShellLog " + process.getProcessInfoString() + " " + msg;
String processInfo = _process.getProcessInfoString() + _process.getProcessTerminationInfoString(); throw new RuntimeException(processInfo, e); } finally {
/** * If both {@link ShellMsg} and {@link ShellProcess} are provided, both * will be used to build the log message. */ @Test public void handleLog_valid() { ShellMsg msg = mockMsg(); ShellProcess process = mockProcess(); logHandler.setUpContext(DefaultShellLogHandlerTest.class, process, null); logHandler.log(msg); verify(msg).getMsg(); verify(process).getProcessInfoString(); } }
private void die(Throwable exception) { String processInfo = _process.getProcessInfoString() + _process.getProcessTerminationInfoString(); _exception = new RuntimeException(processInfo, exception); String message = String.format("Halting process: ShellSpout died. Command: %s, ProcessInfo %s", Arrays.toString(_command), processInfo); LOG.error(message, exception); _collector.reportError(exception); if (_running || (exception instanceof Error)) { //don't exit if not running, unless it is an Error System.exit(11); } }
private void die(Throwable exception) { String processInfo = _process.getProcessInfoString() + _process.getProcessTerminationInfoString(); _exception = new RuntimeException(processInfo, exception); String message = String.format("Halting process: ShellBolt died. Command: %s, ProcessInfo %s", Arrays.toString(_command), processInfo); LOG.error(message, exception); _collector.reportError(exception); if (_running || (exception instanceof Error)) { //don't exit if not running, unless it is an Error System.exit(11); } }
msg = "ShellLog " + msg; } else { msg = "ShellLog " + process.getProcessInfoString() + " " + msg;
String processInfo = _process.getProcessInfoString() + _process.getProcessTerminationInfoString(); throw new RuntimeException(processInfo, e); } finally {