當前位置: 首頁>>代碼示例>>Java>>正文


Java JetInstance.getJob方法代碼示例

本文整理匯總了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();
}
 
開發者ID:hazelcast,項目名稱:hazelcast-jet,代碼行數:23,代碼來源:JobTest.java

示例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();
}
 
開發者ID:hazelcast,項目名稱:hazelcast-jet,代碼行數:18,代碼來源:JobTest.java

示例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();
}
 
開發者ID:hazelcast,項目名稱:hazelcast-jet,代碼行數:25,代碼來源:JobTest.java

示例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();
}
 
開發者ID:hazelcast,項目名稱:hazelcast-jet,代碼行數:19,代碼來源:JobTest.java


注:本文中的com.hazelcast.jet.JetInstance.getJob方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。