@Test public void assertGetSaturnExecutingHome() { File file = ScriptPidUtils.getSaturnExecutingHome(); assertThat(file).exists(); assertThat(file).canRead(); assertThat(file).canWrite(); assertThat(file).isDirectory(); }
public static File getSaturnExecutingHome() { File executingHome = new File(EXECUTINGPATH); try { FileUtils.forceMkdir(executingHome); } catch (Exception ex) { LogUtils.error(log, LogEvents.ExecutorEvent.COMMON, "Creating directory error", ex); } if (executingHome.exists() && executingHome.isDirectory()) { return executingHome; } else { return null; } }
ScriptPidUtils { public static File getSaturnExecutingHome() { File executingHome = new File(EXECUTINGPATH); try { FileUtils.forceMkdir(executingHome); } catch (Exception ex) { LogUtils.error(log, LogEvents.ExecutorEvent.COMMON, "Creating directory error", ex); } if (executingHome.exists() && executingHome.isDirectory()) { return executingHome; } else { return null; } } }
ScriptPidUtils { public static File getSaturnExecutingHome() { File executingHome = new File(EXECUTINGPATH); try { FileUtils.forceMkdir(executingHome); } catch (Exception ex) { LogUtils.error(log, LogEvents.ExecutorEvent.COMMON, "Creating directory error", ex); } if (executingHome.exists() && executingHome.isDirectory()) { return executingHome; } else { return null; } }  }
ScriptPidUtils { public static File getSaturnExecutingHome() { File executingHome = new File(EXECUTINGPATH); try { FileUtils.forceMkdir(executingHome); } catch (Exception ex) { LogUtils.error(log, LogEvents.ExecutorEvent.COMMON, "Creating directory error", ex); } if (executingHome.exists() && executingHome.isDirectory()) { return executingHome; } else { return null; } }  static File getSaturnExecutingHome(); static void writePidToFile(String executorName, String jobName, int jobItem, long pid); @Deprecated static long _getPidFromFile(String executorName, String jobName, String jobItem); static long getFirstPidFromFile(String executorName, String jobName, String jobItem); static List<Long> getPidsFromFile(String executorName, String jobName, String jobItem); static String[] getItemsPaths(String executorName, String jobName); static boolean removeAllPidFile(String executorName, String jobName, String jobItem); static boolean removePidFile(String executorName, String jobName, String jobItem, long pid); static boolean removeAllPidFile(String executorName, String jobName, int jobItem); static void killAllChildrenByPid(long pid, boolean force); static String exeWholeCmd(String cmd); static String exeCmdWithoutPipe(CommandLine cmdLine, ByteArrayInputStream input, Map<String, String> env); static void checkAllExistJobs(final CoordinatorRegistryCenter regCenter); static void forceStopRunningShellJob(final String executorName, final String jobName); static void checkOneExistJob(final CoordinatorRegistryCenter regCenter, final String jobName); static boolean isPidRunning(long pid); static boolean isPidRunning(String pid); static Map<String, String> parseString2Map(String source); static Map<String, String> loadEnv(); static String filterEnvInCmdStr(Map<String, String> env, String cmd); }
ScriptPidUtils { public static File getSaturnExecutingHome() { File executingHome = new File(EXECUTINGPATH); try { FileUtils.forceMkdir(executingHome); } catch (Exception ex) { LogUtils.error(log, LogEvents.ExecutorEvent.COMMON, "Creating directory error", ex); } if (executingHome.exists() && executingHome.isDirectory()) { return executingHome; } else { return null; } }  static File getSaturnExecutingHome(); static void writePidToFile(String executorName, String jobName, int jobItem, long pid); @Deprecated static long _getPidFromFile(String executorName, String jobName, String jobItem); static long getFirstPidFromFile(String executorName, String jobName, String jobItem); static List<Long> getPidsFromFile(String executorName, String jobName, String jobItem); static String[] getItemsPaths(String executorName, String jobName); static boolean removeAllPidFile(String executorName, String jobName, String jobItem); static boolean removePidFile(String executorName, String jobName, String jobItem, long pid); static boolean removeAllPidFile(String executorName, String jobName, int jobItem); static void killAllChildrenByPid(long pid, boolean force); static String exeWholeCmd(String cmd); static String exeCmdWithoutPipe(CommandLine cmdLine, ByteArrayInputStream input, Map<String, String> env); static void checkAllExistJobs(final CoordinatorRegistryCenter regCenter); static void forceStopRunningShellJob(final String executorName, final String jobName); static void checkOneExistJob(final CoordinatorRegistryCenter regCenter, final String jobName); static boolean isPidRunning(long pid); static boolean isPidRunning(String pid); static Map<String, String> parseString2Map(String source); static Map<String, String> loadEnv(); static String filterEnvInCmdStr(Map<String, String> env, String cmd); static final long UNKNOWN_PID; static final String EXECUTINGPATH; static final String OUTPUT_PATH; static final String EXECUTINGJOBPATH; static final String JOBITEMPIDSPATH; static final String JOBITEMPATH; static final String JOBITEMPIDPATH2; static final String JOBITEMOUTPUTPATH; }