本文整理匯總了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();
}