@Test public void asyncExecShellCommand() throws IOException, InterruptedException { if (SystemUtil.isUnix()) { int exitCode = FlinkShellSubmitAssist.syncExecShellCommand("echo hello plink"); assert exitCode == 0; } }
public static int syncExecShellCommand(String command) throws IOException, InterruptedException { ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.command("/bin/sh", "-c", command); Process process = processBuilder.start(); return process.waitFor(); }
FlinkShellSubmitAssist { public static int syncExecShellCommand(String command) throws IOException, InterruptedException { ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.command("/bin/sh", "-c", command); Process process = processBuilder.start(); return process.waitFor(); } }
FlinkShellSubmitAssist { public static int syncExecShellCommand(String command) throws IOException, InterruptedException { ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.command("/bin/sh", "-c", command); Process process = processBuilder.start(); return process.waitFor(); } FlinkShellSubmitAssist(FlinkShellCommandBuilder flinkShellCommandBuilder, String appIdRegex); }
FlinkShellSubmitAssist { public static int syncExecShellCommand(String command) throws IOException, InterruptedException { ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.command("/bin/sh", "-c", command); Process process = processBuilder.start(); return process.waitFor(); } FlinkShellSubmitAssist(FlinkShellCommandBuilder flinkShellCommandBuilder, String appIdRegex); String submitJob(JobInstanceDTO jobInstanceDTO, String logFile); static int syncExecShellCommand(String command); }
FlinkShellSubmitAssist { public static int syncExecShellCommand(String command) throws IOException, InterruptedException { ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.command("/bin/sh", "-c", command); Process process = processBuilder.start(); return process.waitFor(); } FlinkShellSubmitAssist(FlinkShellCommandBuilder flinkShellCommandBuilder, String appIdRegex); String submitJob(JobInstanceDTO jobInstanceDTO, String logFile); static int syncExecShellCommand(String command);  }