当前位置: 首页>>代码示例>>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;未经允许,请勿转载。