use of org.apache.hyracks.api.job.JobId in project asterixdb by apache.
the class JobManagerTest method mockJobRun.
private JobRun mockJobRun(long id) {
JobRun run = mock(JobRun.class, Mockito.RETURNS_DEEP_STUBS);
when(run.getExceptions()).thenReturn(Collections.emptyList());
when(run.getActivityClusterGraph().isReportTaskDetails()).thenReturn(true);
when(run.getPendingExceptions()).thenReturn(Collections.emptyList());
JobId jobId = new JobId(id);
when(run.getJobId()).thenReturn(jobId);
Set<String> nodes = new HashSet<>();
nodes.add("node1");
nodes.add("node2");
when(run.getParticipatingNodeIds()).thenReturn(nodes);
when(run.getCleanupPendingNodeIds()).thenReturn(nodes);
return run;
}
use of org.apache.hyracks.api.job.JobId in project asterixdb by apache.
the class Sort method main.
public static void main(String[] args) throws Exception {
Options options = new Options();
CmdLineParser parser = new CmdLineParser(options);
if (args.length == 0) {
parser.printUsage(System.err);
return;
}
parser.parseArgument(args);
IHyracksClientConnection hcc = new HyracksConnection(options.host, options.port);
JobSpecification job = createJob(parseFileSplits(options.inFileOrderSplits), parseFileSplits(options.outFileSplits), options.memBufferAlg, options.frameLimit, options.frameSize, options.topK, options.usingHeapSorter);
long start = System.currentTimeMillis();
JobId jobId = hcc.startJob(job, options.profile ? EnumSet.of(JobFlag.PROFILE_RUNTIME) : EnumSet.noneOf(JobFlag.class));
hcc.waitForCompletion(jobId);
long end = System.currentTimeMillis();
System.err.println("finished in:" + (end - start) + "ms");
}
use of org.apache.hyracks.api.job.JobId in project asterixdb by apache.
the class HyracksUtils method runJob.
public static void runJob(JobSpecification spec, String appName) throws Exception {
spec.setFrameSize(FRAME_SIZE);
JobId jobId = hcc.startJob(spec, EnumSet.of(JobFlag.PROFILE_RUNTIME));
hcc.waitForCompletion(jobId);
}
use of org.apache.hyracks.api.job.JobId in project asterixdb by apache.
the class HyracksUtils method runJob.
public static void runJob(JobSpecification spec, String appName) throws Exception {
spec.setFrameSize(FRAME_SIZE);
JobId jobId = hcc.startJob(spec, EnumSet.of(JobFlag.PROFILE_RUNTIME));
hcc.waitForCompletion(jobId);
}
use of org.apache.hyracks.api.job.JobId in project asterixdb by apache.
the class JobStatusAPIIntegrationTest method startJob.
protected JobId startJob() throws Exception {
WaitingOperatorDescriptor.CONTINUE_RUNNING.setFalse();
JobSpecification spec = new JobSpecification();
WaitingOperatorDescriptor sourceOpDesc = new WaitingOperatorDescriptor(spec, 0, 0);
PartitionConstraintHelper.addPartitionCountConstraint(spec, sourceOpDesc, 1);
spec.addRoot(sourceOpDesc);
JobId jId = executeTest(spec);
// don't run for more than 100 s
int maxLoops = 1000;
while (maxLoops > 0 && !"RUNNING".equals(getJobStatus(jId))) {
Thread.sleep(100);
--maxLoops;
}
return jId;
}
Aggregations