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

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


        new ScheduledUnit(this, sharingGroup, locationConstraint);
   
      // IMPORTANT: To prevent leaks of cluster resources, we need to make sure that slots are returned
      //     in all cases where the deployment failed. we use many try {} finally {} clauses to assure that
      if (queued) {
        SlotAllocationFuture future = scheduler.scheduleQueued(toSchedule);
       
        future.setFutureAction(new SlotAllocationFutureAction() {
          @Override
          public void slotAllocated(AllocatedSlot slot) {
            try {
              deployToSlot(slot);
            }
View Full Code Here


      final Instance instance = getInstance(taskManager);
      final AllocatedSlot slot = instance.allocateSlot(new JobID());
      slot.cancel();
      assertFalse(slot.isReleased());
     
      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);
     
      // future has not yet a slot
      assertEquals(ExecutionState.SCHEDULED, vertex.getExecutionState());
     
      future.setSlot(slot);
     
      // will have failed
      assertEquals(ExecutionState.FAILED, vertex.getExecutionState());
      assertTrue(slot.isReleased());
     
View Full Code Here

TOP

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

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.