ImmutableMap.<String, Class<? extends Job>>of("java", JavaJob.class,
"command", ProcessJob.class,
"javaprocess", JavaProcessJob.class,
"pig", PigProcessJob.class));
JobManager jobManager = new JobManager(factory,
cl.getLogDir().getAbsolutePath(),
cl.getDefaultProps(),
cl.getJobDirs(),
cl.getClassloader());
File executionsStorageFile = new File(".");
if(!executionsStorageFile.exists()) {
executionsStorageFile.mkdirs();
}
long lastId = 0;
for(File file: executionsStorageFile.listFiles()) {
final String filename = file.getName();
if(filename.endsWith(".json")) {
try {
lastId = Math.max(lastId,
Long.parseLong(filename.substring(0, filename.length() - 5)));
} catch(NumberFormatException e) {}
}
}
final ExecutableFlowSerializer flowSerializer = new DefaultExecutableFlowSerializer();
final ExecutableFlowDeserializer flowDeserializer = new DefaultExecutableFlowDeserializer(jobManager, factory);
FlowExecutionSerializer flowExecutionSerializer = new FlowExecutionSerializer(flowSerializer);
FlowExecutionDeserializer flowExecutionDeserializer = new FlowExecutionDeserializer(flowDeserializer);
FlowManager allFlows = new RefreshableFlowManager(jobManager,
flowExecutionSerializer,
flowExecutionDeserializer,
executionsStorageFile,
lastId);
jobManager.setFlowManager(allFlows);
final CountDownLatch countDown = new CountDownLatch(jobNames.size());
for(String jobName: jobNames) {
try {