Package org.apache.flink.runtime.jobgraph

Examples of org.apache.flink.runtime.jobgraph.JobGraph


     
      final AbstractJobVertex sender = new AbstractJobVertex("Task");
      sender.setInvokableClass(NoOpInvokable.class);
      sender.setParallelism(NUM_TASKS);
     
      final JobGraph jobGraph = new JobGraph("Pointwise Job", sender);
     
      ExecutionGraph eg = new ExecutionGraph(new JobID(), "test job", new Configuration());
      eg.setNumberOfRetriesLeft(0);
      eg.attachJobGraph(jobGraph.getVerticesSortedTopologicallyFromSources());
     
      assertEquals(JobStatus.CREATED, eg.getState());
     
      eg.scheduleForExecution(scheduler);
      assertEquals(JobStatus.RUNNING, eg.getState());
View Full Code Here


     
      final AbstractJobVertex sender = new AbstractJobVertex("Task");
      sender.setInvokableClass(NoOpInvokable.class);
      sender.setParallelism(NUM_TASKS);
     
      final JobGraph jobGraph = new JobGraph("Pointwise Job", sender);
     
      ExecutionGraph eg = new ExecutionGraph(new JobID(), "test job", new Configuration());
      eg.setNumberOfRetriesLeft(1);
      eg.attachJobGraph(jobGraph.getVerticesSortedTopologicallyFromSources());
     
      assertEquals(JobStatus.CREATED, eg.getState());
     
      eg.scheduleForExecution(scheduler);
      assertEquals(JobStatus.RUNNING, eg.getState());
View Full Code Here

      target2.connectNewDataSetAsInput(source1, DistributionPattern.POINTWISE);
      target2.connectNewDataSetAsInput(intermediate2, DistributionPattern.POINTWISE);
      intermediate2.connectNewDataSetAsInput(intermediate1, DistributionPattern.POINTWISE);
      intermediate1.connectNewDataSetAsInput(source2, DistributionPattern.POINTWISE);
     
      JobGraph graph = new JobGraph("TestGraph", source1, source2, intermediate1, intermediate2, target1, target2);
      List<AbstractJobVertex> sorted = graph.getVerticesSortedTopologicallyFromSources();
     
      assertEquals(6, sorted.size());
     
      assertBefore(source1, target1, sorted);
      assertBefore(source1, target2, sorted);
View Full Code Here

      l12.connectNewDataSetAsInput(source1, DistributionPattern.POINTWISE);
      l12.connectNewDataSetAsInput(source2, DistributionPattern.POINTWISE);
     
      l13.connectNewDataSetAsInput(source2, DistributionPattern.POINTWISE);
     
      JobGraph graph = new JobGraph("TestGraph", source1, source2, root, l11, l13, l12, l2);
      List<AbstractJobVertex> sorted = graph.getVerticesSortedTopologicallyFromSources();
     
      assertEquals(7,  sorted.size());
     
      assertBefore(source1, root, sorted);
      assertBefore(source2, root, sorted);
View Full Code Here

      op1.connectNewDataSetAsInput(source, DistributionPattern.POINTWISE);
      op2.connectNewDataSetAsInput(op1, DistributionPattern.POINTWISE);
      op2.connectNewDataSetAsInput(source, DistributionPattern.POINTWISE);
      op3.connectNewDataSetAsInput(op2, DistributionPattern.POINTWISE);
     
      JobGraph graph = new JobGraph("TestGraph", source, op1, op2, op3);
      List<AbstractJobVertex> sorted = graph.getVerticesSortedTopologicallyFromSources();
     
      assertEquals(4,  sorted.size());
     
      assertBefore(source, op1, sorted);
      assertBefore(source, op2, sorted);
View Full Code Here

      v1.connectNewDataSetAsInput(v4, DistributionPattern.POINTWISE);
      v2.connectNewDataSetAsInput(v1, DistributionPattern.POINTWISE);
      v3.connectNewDataSetAsInput(v2, DistributionPattern.POINTWISE);
      v4.connectNewDataSetAsInput(v3, DistributionPattern.POINTWISE);
     
      JobGraph jg = new JobGraph("Cyclic Graph", v1, v2, v3, v4);
      try {
        jg.getVerticesSortedTopologicallyFromSources();
        fail("Failed to raise error on topologically sorting cyclic graph.");
      }
      catch (InvalidProgramException e) {
        // that what we wanted
      }
View Full Code Here

      v2.connectNewDataSetAsInput(v1, DistributionPattern.POINTWISE);
      v3.connectNewDataSetAsInput(v2, DistributionPattern.POINTWISE);
      v4.connectNewDataSetAsInput(v3, DistributionPattern.POINTWISE);
      target.connectNewDataSetAsInput(v3, DistributionPattern.POINTWISE);
     
      JobGraph jg = new JobGraph("Cyclic Graph", v1, v2, v3, v4, source, target);
      try {
        jg.getVerticesSortedTopologicallyFromSources();
        fail("Failed to raise error on topologically sorting cyclic graph.");
      }
      catch (InvalidProgramException e) {
        // that what we wanted
      }
View Full Code Here

     
      final AbstractJobVertex sender = new AbstractJobVertex("Task");
      sender.setInvokableClass(NoOpInvokable.class);
      sender.setParallelism(20);
     
      final JobGraph jobGraph = new JobGraph("Pointwise Job", sender);
     
      ExecutionGraph eg = new ExecutionGraph(new JobID(), "test job", new Configuration());
      eg.setNumberOfRetriesLeft(0);
      eg.attachJobGraph(jobGraph.getVerticesSortedTopologicallyFromSources());
     
     
      assertEquals(JobStatus.CREATED, eg.getState());
     
      eg.scheduleForExecution(scheduler);
View Full Code Here

     
      SlotSharingGroup sharingGroup = new SlotSharingGroup(sender.getID(), receiver.getID());
      sender.setSlotSharingGroup(sharingGroup);
      receiver.setSlotSharingGroup(sharingGroup);
     
      final JobGraph jobGraph = new JobGraph("Pointwise Job", sender, receiver);
     
      final JobManager jm = startJobManager(NUM_TASKS);
     
      final GlobalBufferPool bp = ((LocalInstanceManager) jm.getInstanceManager())
          .getTaskManagers()[0].getChannelManager().getGlobalBufferPool();
     
      try {
        JobSubmissionResult result = jm.submitJob(jobGraph);

        if (result.getReturnCode() != AbstractJobResult.ReturnCode.SUCCESS) {
          System.out.println(result.getDescription());
        }
        assertEquals(AbstractJobResult.ReturnCode.SUCCESS, result.getReturnCode());
       
        // monitor the execution
        ExecutionGraph eg = jm.getCurrentJobs().get(jobGraph.getJobID());
       
        if (eg != null) {
          eg.waitForJobEnd();
          assertEquals(JobStatus.FINISHED, eg.getState());
        }
View Full Code Here

      receiver.setSlotSharingGroup(sharingGroup);;
     
      receiver.connectNewDataSetAsInput(sender1, DistributionPattern.POINTWISE);
      receiver.connectNewDataSetAsInput(sender2, DistributionPattern.BIPARTITE);
     
      final JobGraph jobGraph = new JobGraph("Bipartite Job", sender1, receiver, sender2);
     
      JobManager jm = startJobManager(NUM_TASKS);
     
      final GlobalBufferPool bp = ((LocalInstanceManager) jm.getInstanceManager())
                .getTaskManagers()[0].getChannelManager().getGlobalBufferPool();
     
      try {
        JobSubmissionResult result = jm.submitJob(jobGraph);

        if (result.getReturnCode() != AbstractJobResult.ReturnCode.SUCCESS) {
          System.out.println(result.getDescription());
        }
        assertEquals(AbstractJobResult.ReturnCode.SUCCESS, result.getReturnCode());
       
        // monitor the execution
        ExecutionGraph eg = jm.getCurrentJobs().get(jobGraph.getJobID());
       
        if (eg != null) {
          eg.waitForJobEnd();
          assertEquals(JobStatus.FINISHED, eg.getState());
        }
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.jobgraph.JobGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.