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

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


     
      // 1)
      // scheduling after being created should be tolerated (no exception) because
      // it can occur as the result of races
      {
        Scheduler scheduler = mock(Scheduler.class);
        vertex.scheduleForExecution(scheduler, false);
       
        assertEquals(ExecutionState.CANCELED, vertex.getExecutionState());
      }
     
View Full Code Here


      // scheduling while canceling is an illegal state transition
      try {
        ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
        setVertexState(vertex, ExecutionState.CANCELING);
       
        Scheduler scheduler = mock(Scheduler.class);
        vertex.scheduleForExecution(scheduler, false);
      }
      catch (Exception e) {
        fail("should not throw an exception");
      }
View Full Code Here

        final ExecutionAttemptID id = (ExecutionAttemptID) invocation.getArguments()[0];
        return new TaskOperationResult(id, true);
      }
    });
   
    Scheduler scheduler = new Scheduler();
    for (int i = 0; i < dop1 + dop2; i++) {
      scheduler.newInstanceAvailable(getInstance(taskManager));
    }
    assertEquals(dop1 + dop2, scheduler.getNumberOfAvailableSlots());
   
    // schedule, this triggers mock deployment
    eg.scheduleForExecution(scheduler);
   
    Map<ExecutionAttemptID, Execution> executions = eg.getRegisteredExecutions();
View Full Code Here

   
    try {
      TaskOperationProtocol tm = getSimpleAcknowledgingTaskmanager();
      Instance instance = getInstance(tm);
     
      Scheduler scheduler = new Scheduler();
      scheduler.newInstanceAvailable(instance);
     
      // The job:
     
      final AbstractJobVertex sender = new AbstractJobVertex("Task");
      sender.setInvokableClass(NoOpInvokable.class);
View Full Code Here

   
    try {
      TaskOperationProtocol tm = getSimpleAcknowledgingTaskmanager();
      Instance instance = getInstance(tm);
     
      Scheduler scheduler = new Scheduler();
      scheduler.newInstanceAvailable(instance);
     
      // The job:
     
      final AbstractJobVertex sender = new AbstractJobVertex("Task");
      sender.setInvokableClass(NoOpInvokable.class);
View Full Code Here

      TaskOperationProtocol tm2 = getSimpleAcknowledgingTaskmanager();
     
      Instance instance1 = getInstance(tm1, 10);
      Instance instance2 = getInstance(tm2, 10);
     
      Scheduler scheduler = new Scheduler();
      scheduler.newInstanceAvailable(instance1);
      scheduler.newInstanceAvailable(instance2);
     
      // The job:
     
      final AbstractJobVertex sender = new AbstractJobVertex("Task");
      sender.setInvokableClass(NoOpInvokable.class);
View Full Code Here

    else {
      throw new IllegalArgumentException("ExecutionMode");
    }

    // create the scheduler and make it listen at the availability of new instances
    this.scheduler = new Scheduler(this.executorService);
    this.instanceManager.addInstanceListener(this.scheduler);
  }
View Full Code Here

      assertFalse(slot.isReleased());
     
      final ExecutionJobVertex ejv = getJobVertexNotExecuting(new JobVertexID());
      final ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
     
      Scheduler scheduler = mock(Scheduler.class);
      when(scheduler.scheduleImmediately(Matchers.any(ScheduledUnit.class))).thenReturn(slot);
     
      assertEquals(ExecutionState.CREATED, vertex.getExecutionState());
      // try to deploy to the slot
      vertex.scheduleForExecution(scheduler, false);
     
View Full Code Here

      final SlotAllocationFuture future = new SlotAllocationFuture();
     
      final ExecutionJobVertex ejv = getJobVertexNotExecuting(new JobVertexID());
      final ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
     
      Scheduler scheduler = mock(Scheduler.class);
      when(scheduler.scheduleQueued(Matchers.any(ScheduledUnit.class))).thenReturn(future);
     
      assertEquals(ExecutionState.CREATED, vertex.getExecutionState());
      // try to deploy to the slot
      vertex.scheduleForExecution(scheduler, true);
     
View Full Code Here

      final AllocatedSlot slot = instance.allocateSlot(new JobID());
     
      final ExecutionJobVertex ejv = getJobVertexNotExecuting(new JobVertexID());
      final ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
     
      Scheduler scheduler = mock(Scheduler.class);
      when(scheduler.scheduleImmediately(Matchers.any(ScheduledUnit.class))).thenReturn(slot);
     
      assertEquals(ExecutionState.CREATED, vertex.getExecutionState());

      // try to deploy to the slot
      vertex.scheduleForExecution(scheduler, false);
View Full Code Here

TOP

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

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.