Search in sources :

Example 41 with ReservationSubmissionRequest

use of org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest in project hadoop by apache.

the class TestYarnClient method createSimpleReservationRequest.

private ReservationSubmissionRequest createSimpleReservationRequest(ReservationId reservationId, int numContainers, long arrival, long deadline, long duration) {
    // create a request with a single atomic ask
    ReservationRequest r = ReservationRequest.newInstance(Resource.newInstance(1024, 1), numContainers, 1, duration);
    ReservationRequests reqs = ReservationRequests.newInstance(Collections.singletonList(r), ReservationRequestInterpreter.R_ALL);
    ReservationDefinition rDef = ReservationDefinition.newInstance(arrival, deadline, reqs, "testYarnClient#reservation");
    ReservationSubmissionRequest request = ReservationSubmissionRequest.newInstance(rDef, ReservationSystemTestUtil.reservationQ, reservationId);
    return request;
}
Also used : ReservationRequest(org.apache.hadoop.yarn.api.records.ReservationRequest) ReservationDefinition(org.apache.hadoop.yarn.api.records.ReservationDefinition) ReservationRequests(org.apache.hadoop.yarn.api.records.ReservationRequests) ReservationSubmissionRequest(org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest)

Example 42 with ReservationSubmissionRequest

use of org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest in project hadoop by apache.

the class TestYarnClient method submitReservationTestHelper.

private ReservationSubmissionRequest submitReservationTestHelper(YarnClient client, long arrival, long deadline, long duration) throws IOException, YarnException {
    ReservationId reservationID = client.createReservation().getReservationId();
    ReservationSubmissionRequest sRequest = createSimpleReservationRequest(reservationID, 4, arrival, deadline, duration);
    ReservationSubmissionResponse sResponse = client.submitReservation(sRequest);
    Assert.assertNotNull(sResponse);
    Assert.assertNotNull(reservationID);
    System.out.println("Submit reservation response: " + reservationID);
    return sRequest;
}
Also used : ReservationId(org.apache.hadoop.yarn.api.records.ReservationId) ReservationSubmissionRequest(org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest) ReservationSubmissionResponse(org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionResponse)

Aggregations

ReservationSubmissionRequest (org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest)42 Test (org.junit.Test)34 YarnException (org.apache.hadoop.yarn.exceptions.YarnException)22 ReservationId (org.apache.hadoop.yarn.api.records.ReservationId)19 ReservationDefinition (org.apache.hadoop.yarn.api.records.ReservationDefinition)14 Clock (org.apache.hadoop.yarn.util.Clock)14 UTCClock (org.apache.hadoop.yarn.util.UTCClock)14 ReservationSubmissionResponse (org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionResponse)12 IOException (java.io.IOException)10 ReservationListRequest (org.apache.hadoop.yarn.api.protocolrecords.ReservationListRequest)10 ReservationListResponse (org.apache.hadoop.yarn.api.protocolrecords.ReservationListResponse)10 ApplicationNotFoundException (org.apache.hadoop.yarn.exceptions.ApplicationNotFoundException)9 AccessControlException (java.security.AccessControlException)8 BrokenBarrierException (java.util.concurrent.BrokenBarrierException)8 YarnClient (org.apache.hadoop.yarn.client.api.YarnClient)7 MiniYARNCluster (org.apache.hadoop.yarn.server.MiniYARNCluster)7 ReservationRequest (org.apache.hadoop.yarn.api.records.ReservationRequest)6 ReservationRequests (org.apache.hadoop.yarn.api.records.ReservationRequests)6 ReservationDeleteRequest (org.apache.hadoop.yarn.api.protocolrecords.ReservationDeleteRequest)5 ReservationUpdateRequest (org.apache.hadoop.yarn.api.protocolrecords.ReservationUpdateRequest)5