public ShellMsg readShellMsg() throws IOException { try { return serializer.readShellMsg(); } catch (NoOutputException e) { throw new RuntimeException(e + getErrorsString() + "\n"); } }
public String getProcessTerminationInfoString() { return String.format(" exitCode:%s, errorString:%s ", getExitCode(), getErrorsString()); } }
public Number launch(Map<String, Object> conf, TopologyContext context, boolean changeDirectory) { ProcessBuilder builder = new ProcessBuilder(command); if (!env.isEmpty()) { Map<String, String> buildEnv = builder.environment(); modifyEnvironment(buildEnv); } if (changeDirectory) { builder.directory(new File(context.getCodeDir())); } ShellLogger = LoggerFactory.getLogger(context.getThisComponentId()); this.componentName = context.getThisComponentId(); this.serializer = getSerializer(conf); try { _subprocess = builder.start(); processErrorStream = _subprocess.getErrorStream(); serializer.initialize(_subprocess.getOutputStream(), _subprocess.getInputStream()); this.pid = serializer.connect(conf, context); } catch (IOException e) { throw new RuntimeException( "Error when launching multilang subprocess\n" + getErrorsString(), e); } catch (NoOutputException e) { throw new RuntimeException(e + getErrorsString() + "\n"); } return this.pid; }
public ShellMsg readShellMsg() throws IOException { try { return serializer.readShellMsg(); } catch (NoOutputException e) { throw new RuntimeException(e + getErrorsString() + "\n"); } }
public String getProcessTerminationInfoString() { return String.format(" exitCode:%s, errorString:%s ", getExitCode(), getErrorsString()); } }
public Number launch(Map conf, TopologyContext context, boolean changeDirectory) { ProcessBuilder builder = new ProcessBuilder(command); if (!env.isEmpty()) { Map<String, String> buildEnv = builder.environment(); modifyEnvironment(buildEnv); } if (changeDirectory) { builder.directory(new File(context.getCodeDir())); } ShellLogger = LoggerFactory.getLogger(context.getThisComponentId()); this.componentName = context.getThisComponentId(); this.serializer = getSerializer(conf); try { _subprocess = builder.start(); processErrorStream = _subprocess.getErrorStream(); serializer.initialize(_subprocess.getOutputStream(), _subprocess.getInputStream()); this.pid = serializer.connect(conf, context); } catch (IOException e) { throw new RuntimeException( "Error when launching multilang subprocess\n" + getErrorsString(), e); } catch (NoOutputException e) { throw new RuntimeException(e + getErrorsString() + "\n"); } return this.pid; }