本文整理汇总了Java中com.hazelcast.jet.JetInstance.getJob方法的典型用法代码示例。如果您正苦于以下问题:Java JetInstance.getJob方法的具体用法?Java JetInstance.getJob怎么用?Java JetInstance.getJob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.jet.JetInstance
的用法示例。
在下文中一共展示了JetInstance.getJob方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetJobByNameWhenJobIsRunning
import com.hazelcast.jet.JetInstance; //导入方法依赖的package包/类
private void testGetJobByNameWhenJobIsRunning(JetInstance instance) throws InterruptedException {
// Given
DAG dag = new DAG().vertex(new Vertex("test", new MockPS(StuckProcessor::new, NODE_COUNT)));
JobConfig config = new JobConfig();
String jobName = "job1";
config.setName(jobName);
// When
Job job = instance1.newJob(dag, config);
assertEquals(jobName, job.getName());
StuckProcessor.executionStarted.await();
// Then
Job trackedJob = instance.getJob(jobName);
assertNotNull(trackedJob);
assertEquals(jobName, trackedJob.getName());
assertEquals(job.getId(), trackedJob.getId());
assertTrueEventually(() -> assertEquals(RUNNING, trackedJob.getStatus()));
StuckProcessor.proceedLatch.countDown();
}
示例2: testGetJobByIdWhenJobIsRunning
import com.hazelcast.jet.JetInstance; //导入方法依赖的package包/类
private void testGetJobByIdWhenJobIsRunning(JetInstance instance) throws InterruptedException {
// Given
DAG dag = new DAG().vertex(new Vertex("test", new MockPS(StuckProcessor::new, NODE_COUNT)));
// When
Job job = instance1.newJob(dag);
StuckProcessor.executionStarted.await();
// Then
Job trackedJob = instance.getJob(job.getId());
assertNotNull(trackedJob);
assertEquals(job.getId(), trackedJob.getId());
assertTrueEventually(() -> assertEquals(RUNNING, trackedJob.getStatus()));
StuckProcessor.proceedLatch.countDown();
}
示例3: testGetJobByNameWhenMultipleJobsAreRunning
import com.hazelcast.jet.JetInstance; //导入方法依赖的package包/类
private void testGetJobByNameWhenMultipleJobsAreRunning(JetInstance instance) throws InterruptedException {
// Given
DAG dag = new DAG().vertex(new Vertex("test", new MockPS(StuckProcessor::new, NODE_COUNT * 2)));
JobConfig config = new JobConfig();
String jobName = "job1";
config.setName(jobName);
// When
Job job1 = instance1.newJob(dag, config);
sleepAtLeastMillis(1);
Job job2 = instance1.newJob(dag, config);
StuckProcessor.executionStarted.await();
// Then
Job trackedJob = instance.getJob(jobName);
assertNotNull(trackedJob);
assertEquals(jobName, trackedJob.getName());
assertNotEquals(job1.getId(), trackedJob.getId());
assertEquals(job2.getId(), trackedJob.getId());
assertTrueEventually(() -> assertEquals(RUNNING, trackedJob.getStatus()));
StuckProcessor.proceedLatch.countDown();
}
示例4: testJobSubmissionTimeWhenJobIsRunning
import com.hazelcast.jet.JetInstance; //导入方法依赖的package包/类
private void testJobSubmissionTimeWhenJobIsRunning(JetInstance instance) throws InterruptedException {
// Given
DAG dag = new DAG().vertex(new Vertex("test", new MockPS(StuckProcessor::new, NODE_COUNT)));
JobConfig config = new JobConfig();
String jobName = "job1";
config.setName(jobName);
// When
Job job = instance1.newJob(dag, config);
StuckProcessor.executionStarted.await();
Job trackedJob = instance.getJob("job1");
// Then
assertNotNull(trackedJob);
assertNotEquals(0, job.getSubmissionTime());
assertNotEquals(0, trackedJob.getSubmissionTime());
StuckProcessor.proceedLatch.countDown();
}