Package org.apache.flink.runtime.protocols

Examples of org.apache.flink.runtime.protocols.TaskOperationProtocol


  @Test
  public void testRestartManually() {
    final int NUM_TASKS = 31;
   
    try {
      TaskOperationProtocol tm = getSimpleAcknowledgingTaskmanager();
      Instance instance = getInstance(tm);
     
      Scheduler scheduler = new Scheduler();
      scheduler.newInstanceAvailable(instance);
     
View Full Code Here


  @Test
  public void testRestartSelf() {
    final int NUM_TASKS = 31;
   
    try {
      TaskOperationProtocol tm = getSimpleAcknowledgingTaskmanager();
      Instance instance = getInstance(tm);
     
      Scheduler scheduler = new Scheduler();
      scheduler.newInstanceAvailable(instance);
     
View Full Code Here

public class TaskManagerLossFailsTasksTest {

  @Test
  public void testTasksFailWhenTaskManagerLost() {
    try {
      TaskOperationProtocol tm1 = getSimpleAcknowledgingTaskmanager();
      TaskOperationProtocol tm2 = getSimpleAcknowledgingTaskmanager();
     
      Instance instance1 = getInstance(tm1, 10);
      Instance instance2 = getInstance(tm2, 10);
     
      Scheduler scheduler = new Scheduler();
View Full Code Here

  @Test
  public void testSlotReleasedWhenScheduledImmediately() {
   
    try {
      // a slot than cannot be deployed to
      final TaskOperationProtocol taskManager = mock(TaskOperationProtocol.class);
      final Instance instance = getInstance(taskManager);
      final AllocatedSlot slot = instance.allocateSlot(new JobID());
      slot.cancel();
      assertFalse(slot.isReleased());
     
View Full Code Here

  @Test
  public void testSlotReleasedWhenScheduledQueued() {

    try {
      // a slot than cannot be deployed to
      final TaskOperationProtocol taskManager = mock(TaskOperationProtocol.class);
      final Instance instance = getInstance(taskManager);
      final AllocatedSlot slot = instance.allocateSlot(new JobID());
      slot.cancel();
      assertFalse(slot.isReleased());
     
View Full Code Here

 
  @Test
  public void testScheduleToDeploy() {
    try {
      // a slot than cannot be deployed to
      final TaskOperationProtocol taskManager = mock(TaskOperationProtocol.class);
      final Instance instance = getInstance(taskManager);
      final AllocatedSlot slot = instance.allocateSlot(new JobID());
     
      final ExecutionJobVertex ejv = getJobVertexNotExecuting(new JobVertexID());
      final ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
View Full Code Here

      }
    };
  }
 
  public static TaskOperationProtocol getSimpleAcknowledgingTaskmanager() throws Exception {
    TaskOperationProtocol top = mock(TaskOperationProtocol.class);
   
    when(top.submitTask(any(TaskDeploymentDescriptor.class))).thenAnswer(new Answer<TaskOperationResult>() {
      @Override
      public TaskOperationResult answer(InvocationOnMock invocation) {
        final TaskDeploymentDescriptor tdd = (TaskDeploymentDescriptor) invocation.getArguments()[0];
        return new TaskOperationResult(tdd.getExecutionId(), true);
      }
    });
   
    when(top.cancelTask(Matchers.any(ExecutionAttemptID.class))).thenAnswer(new Answer<TaskOperationResult>() {
      @Override
      public TaskOperationResult answer(InvocationOnMock invocation) {
        final ExecutionAttemptID id = (ExecutionAttemptID) invocation.getArguments()[0];
        return new TaskOperationResult(id, true);
      }
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.protocols.TaskOperationProtocol

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.