Examples of HeldContainer


Examples of org.apache.tez.dag.app.rm.TaskScheduler.HeldContainer

    when(mockContainer4.getId()).thenReturn(mockCId4);
    containers.clear();
    containers.add(mockContainer4);
   
    // Fudge new container being present in delayed allocation list due to race
    HeldContainer heldContainer = new HeldContainer(mockContainer4, -1, -1, null);
    scheduler.delayedContainerManager.delayedContainers.add(heldContainer);
    // no preemption - container assignment attempts < 3
    scheduler.getProgress();
    drainableAppCallback.drain();
    verify(mockRMClient, times(0)).releaseAssignedContainer((ContainerId)any());
    heldContainer.incrementAssignmentAttempts();
    // no preemption - container assignment attempts < 3
    scheduler.getProgress();
    drainableAppCallback.drain();
    verify(mockRMClient, times(0)).releaseAssignedContainer((ContainerId)any());
    heldContainer.incrementAssignmentAttempts();
    heldContainer.incrementAssignmentAttempts();
    // preemption - container released and resource asked again
    scheduler.getProgress();
    drainableAppCallback.drain();
    verify(mockRMClient, times(1)).releaseAssignedContainer((ContainerId)any());
    verify(mockRMClient, times(1)).releaseAssignedContainer(mockCId4);
View Full Code Here

Examples of org.apache.tez.dag.app.rm.YarnTaskSchedulerService.HeldContainer

    String node2Rack2 = "n2r2";
    String node1Rack3 = "n1r3";
    ApplicationAttemptId appId = ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 0), 0);

    ContainerId mockCId1 = ContainerId.newInstance(appId, 0);
    HeldContainer hc1 = mock(HeldContainer.class, RETURNS_DEEP_STUBS);
    when(hc1.getNode()).thenReturn(node1Rack1);
    when(hc1.getRack()).thenReturn(rack1);
    when(hc1.getContainer().getId()).thenReturn(mockCId1);
    ContainerId mockCId2 = ContainerId.newInstance(appId, 1);
    HeldContainer hc2 = mock(HeldContainer.class, RETURNS_DEEP_STUBS);
    when(hc2.getNode()).thenReturn(node2Rack1);
    when(hc2.getRack()).thenReturn(rack1);
    when(hc2.getContainer().getId()).thenReturn(mockCId2);
    ContainerId mockCId3 = ContainerId.newInstance(appId, 2);
    HeldContainer hc3 = mock(HeldContainer.class, RETURNS_DEEP_STUBS);
    when(hc3.getNode()).thenReturn(node1Rack1);
    when(hc3.getRack()).thenReturn(rack1);
    when(hc3.getContainer().getId()).thenReturn(mockCId3);
    ContainerId mockCId4 = ContainerId.newInstance(appId, 3);
    HeldContainer hc4 = mock(HeldContainer.class, RETURNS_DEEP_STUBS);
    when(hc4.getNode()).thenReturn(node2Rack1);
    when(hc4.getRack()).thenReturn(rack1);
    when(hc4.getContainer().getId()).thenReturn(mockCId4);
    ContainerId mockCId5 = ContainerId.newInstance(appId, 4);
    HeldContainer hc5 = mock(HeldContainer.class, RETURNS_DEEP_STUBS);
    when(hc5.getNode()).thenReturn(node1Rack2);
    when(hc5.getRack()).thenReturn(rack2);
    when(hc5.getContainer().getId()).thenReturn(mockCId5);
    ContainerId mockCId6 = ContainerId.newInstance(appId, 5);
    HeldContainer hc6 = mock(HeldContainer.class, RETURNS_DEEP_STUBS);
    when(hc6.getNode()).thenReturn(node2Rack2);
    when(hc6.getRack()).thenReturn(rack2);
    when(hc6.getContainer().getId()).thenReturn(mockCId6);
    ContainerId mockCId7 = ContainerId.newInstance(appId, 6);
    HeldContainer hc7 = mock(HeldContainer.class, RETURNS_DEEP_STUBS);
    when(hc7.getNode()).thenReturn(node1Rack3);
    when(hc7.getRack()).thenReturn(rack3);
    when(hc7.getContainer().getId()).thenReturn(mockCId7);
   
    scheduler.heldContainers.put(mockCId1, hc1);
    scheduler.heldContainers.put(mockCId2, hc2);
    scheduler.heldContainers.put(mockCId3, hc3);
    scheduler.heldContainers.put(mockCId4, hc4);
View Full Code Here

Examples of org.apache.tez.dag.app.rm.YarnTaskSchedulerService.HeldContainer

    when(mockContainer4.getId()).thenReturn(mockCId4);
    containers.clear();
    containers.add(mockContainer4);
   
    // Fudge new container being present in delayed allocation list due to race
    HeldContainer heldContainer = new HeldContainer(mockContainer4, -1, -1, null);
    scheduler.delayedContainerManager.delayedContainers.add(heldContainer);
    // no preemption - container assignment attempts < 3
    scheduler.getProgress();
    drainableAppCallback.drain();
    verify(mockRMClient, times(0)).releaseAssignedContainer((ContainerId)any());
    heldContainer.incrementAssignmentAttempts();
    // no preemption - container assignment attempts < 3
    scheduler.getProgress();
    drainableAppCallback.drain();
    verify(mockRMClient, times(0)).releaseAssignedContainer((ContainerId)any());
    heldContainer.incrementAssignmentAttempts();
    heldContainer.incrementAssignmentAttempts();
    // preemption - container released and resource asked again
    scheduler.getProgress();
    drainableAppCallback.drain();
    verify(mockRMClient, times(1)).releaseAssignedContainer((ContainerId)any());
    verify(mockRMClient, times(1)).releaseAssignedContainer(mockCId4);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.