use of org.apache.hyracks.api.job.ActivityClusterGraph in project asterixdb by apache.
the class JobManager method createJobLogObject.
private ObjectNode createJobLogObject(final JobRun run) {
ObjectMapper om = new ObjectMapper();
ObjectNode jobLogObject = om.createObjectNode();
ActivityClusterGraph acg = run.getActivityClusterGraph();
jobLogObject.set("activity-cluster-graph", acg.toJSON());
jobLogObject.set("job-run", run.toJSON());
return jobLogObject;
}
use of org.apache.hyracks.api.job.ActivityClusterGraph in project asterixdb by apache.
the class DistributeJobWork method doRun.
@Override
protected void doRun() throws Exception {
try {
final CCServiceContext ccServiceCtx = ccs.getContext();
ccs.getPreDistributedJobStore().checkForExistingDistributedJobDescriptor(jobId);
IActivityClusterGraphGeneratorFactory acggf = (IActivityClusterGraphGeneratorFactory) DeploymentUtils.deserialize(acggfBytes, null, ccServiceCtx);
IActivityClusterGraphGenerator acgg = acggf.createActivityClusterGraphGenerator(jobId, ccServiceCtx, EnumSet.noneOf(JobFlag.class));
ActivityClusterGraph acg = acgg.initialize();
ccs.getPreDistributedJobStore().addDistributedJobDescriptor(jobId, acg, acggf.getJobSpecification(), acgg.getConstraints());
ccServiceCtx.notifyJobCreation(jobId, acggf.getJobSpecification());
byte[] acgBytes = JavaSerializationUtils.serialize(acg);
INodeManager nodeManager = ccs.getNodeManager();
for (NodeControllerState node : nodeManager.getAllNodeControllerStates()) {
node.getNodeController().distributeJob(jobId, acgBytes);
}
callback.setValue(jobId);
} catch (Exception e) {
callback.setException(e);
}
}
Aggregations