Package org.apache.flink.runtime.jobmanager.scheduler

Examples of org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup


    private JobGraph createJobGraph(int dataVolumeGb, boolean useForwarder, boolean isSlowSender,
        boolean isSlowReceiver, int numSubtasks)
    {
      JobGraph jobGraph = new JobGraph("Speed Test");
      SlotSharingGroup sharingGroup = new SlotSharingGroup();

      AbstractJobVertex producer = new AbstractJobVertex("Speed Test Producer");
      jobGraph.addVertex(producer);
      producer.setSlotSharingGroup(sharingGroup);
     
View Full Code Here


    // --------------------------------------------------------------------------------------------------------------
    // 3. INSTANCE SHARING
    // --------------------------------------------------------------------------------------------------------------
   
    SlotSharingGroup sharingGroup = new SlotSharingGroup();
   
    input.setSlotSharingGroup(sharingGroup);
    head.setSlotSharingGroup(sharingGroup);
    tail.setSlotSharingGroup(sharingGroup);
    output.setSlotSharingGroup(sharingGroup);
View Full Code Here

  /**
   * Sets slot sharing for the vertices.
   */
  private void setSlotSharing() {
    SlotSharingGroup shareGroup = new SlotSharingGroup();

    for (AbstractJobVertex vertex : streamVertices.values()) {
      vertex.setSlotSharingGroup(shareGroup);
    }

View Full Code Here

      sender.setParallelism(NUM_TASKS);
      receiver.setParallelism(NUM_TASKS);
     
      receiver.connectNewDataSetAsInput(sender, DistributionPattern.POINTWISE);
     
      SlotSharingGroup sharingGroup = new SlotSharingGroup();
      sender.setSlotSharingGroup(sharingGroup);
      receiver.setSlotSharingGroup(sharingGroup);
     
      final JobGraph jobGraph = new JobGraph("Pointwise Job", sender, receiver);
      jobGraph.setNumberOfExecutionRetries(1);
View Full Code Here

      sender.setParallelism(NUM_TASKS);
      receiver.setParallelism(NUM_TASKS);
     
      receiver.connectNewDataSetAsInput(sender, DistributionPattern.POINTWISE);
     
      SlotSharingGroup sharingGroup = new SlotSharingGroup();
      sender.setSlotSharingGroup(sharingGroup);
      receiver.setSlotSharingGroup(sharingGroup);
     
      final JobGraph jobGraph = new JobGraph("Pointwise Job", sender, receiver);
      jobGraph.setNumberOfExecutionRetries(1);
View Full Code Here

      sender.setParallelism(NUM_TASKS);
      receiver.setParallelism(NUM_TASKS);
     
      receiver.connectNewDataSetAsInput(sender, DistributionPattern.POINTWISE);
     
      SlotSharingGroup sharingGroup = new SlotSharingGroup(sender.getID(), receiver.getID());
      sender.setSlotSharingGroup(sharingGroup);
      receiver.setSlotSharingGroup(sharingGroup);
     
      receiver.setStrictlyCoLocatedWith(sender);
     
View Full Code Here

      receiver.setInvokableClass(BlockingReceiver.class);
      sender.setParallelism(NUM_TASKS);
      receiver.setParallelism(NUM_TASKS);
      receiver.connectNewDataSetAsInput(sender, DistributionPattern.POINTWISE);
     
      SlotSharingGroup sharingGroup = new SlotSharingGroup();
      sender.setSlotSharingGroup(sharingGroup);
      receiver.setSlotSharingGroup(sharingGroup);
     
      final JobGraph jobGraph = new JobGraph("Pointwise Job", sender, receiver);
     
View Full Code Here

      AbstractJobVertex v1 = new AbstractJobVertex("vertex1");
      AbstractJobVertex v2 = new AbstractJobVertex("vertex2");
      v1.setParallelism(6);
      v2.setParallelism(4);
     
      SlotSharingGroup sl1 = new SlotSharingGroup();
      v1.setSlotSharingGroup(sl1);
      v2.setSlotSharingGroup(sl1);
      v2.setStrictlyCoLocatedWith(v1);
      v1.setStrictlyCoLocatedWith(v2);
     
      // complex forked dependency pattern
      AbstractJobVertex v3 = new AbstractJobVertex("vertex3");
      AbstractJobVertex v4 = new AbstractJobVertex("vertex4");
      AbstractJobVertex v5 = new AbstractJobVertex("vertex5");
      AbstractJobVertex v6 = new AbstractJobVertex("vertex6");
      AbstractJobVertex v7 = new AbstractJobVertex("vertex7");
      v3.setParallelism(3);
      v4.setParallelism(3);
      v5.setParallelism(3);
      v6.setParallelism(3);
      v7.setParallelism(3);
     
      SlotSharingGroup sl2 = new SlotSharingGroup();
      v3.setSlotSharingGroup(sl2);
      v4.setSlotSharingGroup(sl2);
      v5.setSlotSharingGroup(sl2);
      v6.setSlotSharingGroup(sl2);
      v7.setSlotSharingGroup(sl2);
View Full Code Here

  public void scheduleForExecution(Scheduler scheduler, boolean queued) throws NoResourceAvailableException {
    if (scheduler == null) {
      throw new NullPointerException();
    }
   
    final SlotSharingGroup sharingGroup = vertex.getJobVertex().getSlotSharingGroup();
    final CoLocationConstraint locationConstraint = vertex.getLocationConstraint();
   
    // sanity check
    if (locationConstraint != null && sharingGroup == null) {
      throw new RuntimeException("Trying to schedule with co-location constraint but without slot sharing allowed.");
View Full Code Here

      v5.setParallelism(11);
     
      v2.connectNewDataSetAsInput(v1, DistributionPattern.POINTWISE);
      v5.connectNewDataSetAsInput(v4, DistributionPattern.POINTWISE);
     
      SlotSharingGroup jg1 = new SlotSharingGroup();
      v2.setSlotSharingGroup(jg1);
      v3.setSlotSharingGroup(jg1);
     
      SlotSharingGroup jg2 = new SlotSharingGroup();
      v4.setSlotSharingGroup(jg2);
      v5.setSlotSharingGroup(jg2);
     
      List<AbstractJobVertex> vertices = new ArrayList<AbstractJobVertex>(Arrays.asList(v1, v2, v3, v4, v5));
     
      ExecutionGraph eg = new ExecutionGraph(new JobID(), "test job", new Configuration());
      eg.attachJobGraph(vertices);
     
      // verify that the vertices are all in the same slot sharing group
      SlotSharingGroup group1 = null;
      SlotSharingGroup group2 = null;
     
      // verify that v1 tasks have no slot sharing group
      assertNull(eg.getJobVertex(v1.getID()).getSlotSharingGroup());
     
      // v2 and v3 are shared
      group1 = eg.getJobVertex(v2.getID()).getSlotSharingGroup();
      assertNotNull(group1);
      assertEquals(group1, eg.getJobVertex(v3.getID()).getSlotSharingGroup());
     
      assertEquals(2, group1.getJobVertexIds().size());
      assertTrue(group1.getJobVertexIds().contains(v2.getID()));
      assertTrue(group1.getJobVertexIds().contains(v3.getID()));
     
      // v4 and v5 are shared
      group2 = eg.getJobVertex(v4.getID()).getSlotSharingGroup();
      assertNotNull(group2);
      assertEquals(group2, eg.getJobVertex(v5.getID()).getSlotSharingGroup());
     
      assertEquals(2, group1.getJobVertexIds().size());
      assertTrue(group2.getJobVertexIds().contains(v4.getID()));
      assertTrue(group2.getJobVertexIds().contains(v5.getID()));
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup

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.