Package org.apache.hadoop.yarn.api.records

Examples of org.apache.hadoop.yarn.api.records.Priority


    // host_0_0: 8G
    // host_0_1: 8G
    // host_1_0: 8G
    // host_1_1: 8G
    // Blacklist: <host_0_0>
    Priority priority = TestUtils.createMockPriority(1);
    List<ResourceRequest> app_0_requests_0 = new ArrayList<ResourceRequest>();
    app_0_requests_0.add(
        TestUtils.createResourceRequest(host_0_0, 1*GB, 1,
            true, priority, recordFactory));
    app_0_requests_0.add(
View Full Code Here


    Resource clusterResource =
        Resources.createResource(numNodes * (8 * GB), numNodes * 16);
    when(csContext.getNumClusterNodes()).thenReturn(numNodes);

    // Setup resource-requests
    Priority priority = TestUtils.createMockPriority(1);
    app_0.updateResourceRequests(Arrays.asList(TestUtils.createResourceRequest(
        "127.0.0.1", 1 * GB, 3, true, priority, recordFactory), TestUtils
        .createResourceRequest(DEFAULT_RACK, 1 * GB, 3, true, priority,
            recordFactory)));

View Full Code Here

    ResourceRequest request = recordFactory
        .newRecordInstance(ResourceRequest.class);
    request.setCapability(Resources.createResource(memory));
    request.setResourceName(host);
    request.setNumContainers(numContainers);
    Priority prio = recordFactory.newRecordInstance(Priority.class);
    prio.setPriority(priority);
    request.setPriority(prio);
    return request;
  }
View Full Code Here

      registerNode(host_1, 1234, 2345, NetworkTopology.DEFAULT_RACK,
          Resources.createResource(2 * GB, 1));
    nm_1.heartbeat();

    // ResourceRequest priorities
    Priority priority_0 =
      org.apache.hadoop.yarn.server.resourcemanager.resource.Priority.create(0);
    Priority priority_1 =
      org.apache.hadoop.yarn.server.resourcemanager.resource.Priority.create(1);
   
    // Submit an application
    Application application_0 = new Application("user_0", resourceManager);
    application_0.submit();
View Full Code Here

  }

  protected Container allocateContainer(Object appmaster, int id, String host) throws Exception {
    ContainerId containerId = MockUtils.getMockContainerId(MockUtils.getMockApplicationAttemptId(0, 0), 0);
    NodeId nodeId = MockUtils.getMockNodeId(host, 0);
    Priority priority = MockUtils.getMockPriority(0);
    Container container = MockUtils.getMockContainer(containerId, nodeId, null, priority);
    TestUtils.callMethod("onContainerAllocated", appmaster, new Object[]{container}, new Class<?>[]{Container.class});
    return container;
  }
View Full Code Here

  }

  protected Container allocateContainer(Object appmaster, int id, String host) throws Exception {
    ContainerId containerId = MockUtils.getMockContainerId(MockUtils.getMockApplicationAttemptId(0, 0), 0);
    NodeId nodeId = MockUtils.getMockNodeId(host, 0);
    Priority priority = MockUtils.getMockPriority(0);
    Container container = MockUtils.getMockContainer(containerId, nodeId, null, priority);
    TestUtils.callMethod("onContainerAllocated", appmaster, new Object[]{container}, new Class<?>[]{Container.class});
    return container;
  }
View Full Code Here

    Resource capability = Records.newRecord(Resource.class);
    capability.setMemory(memory);
    ResourceCompat.setVirtualCores(capability, virtualcores);
    context.setResource(capability);

    Priority record = Records.newRecord(Priority.class);
    record.setPriority(priority);
    context.setPriority(record);
    context.setQueue(queue);
    return context;
  }
View Full Code Here

    assertThat(satisfyState.getAllocateData().getRacks().get("/rack3"), is(2));
    assertThat(satisfyState.getRemoveData().size(), is(0));

    ContainerId id1 = MockUtils.getMockContainerId(MockUtils.getMockApplicationAttemptId(0, 0), 1);
    NodeId nodeId1 = MockUtils.getMockNodeId("host1", 0);
    Priority priority = MockUtils.getMockPriority(0);
    Container container1 = MockUtils.getMockContainer(id1, nodeId1, null, priority);
    DefaultGridMember member1 = new DefaultGridMember(container1);
    boolean accepted = projection.acceptMember(member1);
    assertThat(accepted, is(true));
View Full Code Here

    projection.setPriority(0);

    projectedGrid.addProjection(projection);

    ContainerId id = MockUtils.getMockContainerId(MockUtils.getMockApplicationAttemptId(0, 0), 0);
    Priority priority = MockUtils.getMockPriority(0);
    Container container = MockUtils.getMockContainer(id, null, null, priority);
    DefaultGridMember member = new DefaultGridMember(container);
    grid.addMember(member);

//    GridProjection projection2 = projectedGrid.getProjection("test1");
View Full Code Here

    AnyGridProjection projection = new AnyGridProjection();
    projection.setProjectionData(new ProjectionData(1));
    projection.setPriority(0);

    ContainerId id = MockUtils.getMockContainerId(MockUtils.getMockApplicationAttemptId(0, 0), 0);
    Priority priority = MockUtils.getMockPriority(0);
    Container container = MockUtils.getMockContainer(id, null, null, priority);
    projection.acceptMember(new DefaultGridMember(container));

    SatisfyStateData satisfyState = projection.getSatisfyState();
    assertThat(satisfyState, notNullValue());
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.api.records.Priority

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.