use of org.apache.hadoop.yarn.api.ApplicationClientProtocol in project hadoop by apache.
the class QueueACLsTestBase method verifyGetClientAMToken.
private void verifyGetClientAMToken(String submitter, String queueAdmin, String queueName, boolean setupACLs) throws Exception {
ApplicationId applicationId = submitAppAndGetAppId(submitter, queueName, setupACLs);
final GetApplicationReportRequest appReportRequest = GetApplicationReportRequest.newInstance(applicationId);
ApplicationClientProtocol submitterClient = getRMClientForUser(submitter);
ApplicationClientProtocol adMinUserClient = getRMClientForUser(queueAdmin);
GetApplicationReportResponse submitterGetReport = submitterClient.getApplicationReport(appReportRequest);
GetApplicationReportResponse adMinUserGetReport = adMinUserClient.getApplicationReport(appReportRequest);
Assert.assertEquals(submitterGetReport.getApplicationReport().getClientToAMToken(), adMinUserGetReport.getApplicationReport().getClientToAMToken());
}
use of org.apache.hadoop.yarn.api.ApplicationClientProtocol in project hadoop by apache.
the class ReservationACLsTestBase method createReservation.
private ReservationId createReservation(String creator) throws Exception {
ApplicationClientProtocol creatorClient = getRMClientForUser(creator);
GetNewReservationRequest getNewReservationRequest = GetNewReservationRequest.newInstance();
GetNewReservationResponse response = creatorClient.getNewReservation(getNewReservationRequest);
return response.getReservationId();
}
use of org.apache.hadoop.yarn.api.ApplicationClientProtocol in project hadoop by apache.
the class ReservationACLsTestBase method deleteReservation.
private void deleteReservation(String deleter, ReservationId id) throws Exception {
ApplicationClientProtocol deleteClient = getRMClientForUser(deleter);
final ReservationDeleteRequest deleteRequest = ReservationDeleteRequest.newInstance(id);
deleteClient.deleteReservation(deleteRequest);
}
use of org.apache.hadoop.yarn.api.ApplicationClientProtocol in project hadoop by apache.
the class TestApplicationPriorityACLs method verifyAppPriorityIsAccepted.
private void verifyAppPriorityIsAccepted(String submitter, ApplicationId applicationId, int priority) throws IOException, InterruptedException {
ApplicationClientProtocol submitterClient = getRMClientForUser(submitter);
/**
* If priority is greater than cluster max, RM will auto set to cluster max
* Consider this scenario as a special case.
*/
if (priority > clusterMaxPriority) {
priority = clusterMaxPriority;
}
GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(applicationId);
try {
GetApplicationReportResponse response = submitterClient.getApplicationReport(request);
Assert.assertEquals(response.getApplicationReport().getPriority(), Priority.newInstance(priority));
} catch (YarnException e) {
Assert.fail("Application submission should not fail.");
}
}
use of org.apache.hadoop.yarn.api.ApplicationClientProtocol in project hadoop by apache.
the class ReservationACLsTestBase method listReservationById.
private ReservationListResponse listReservationById(String lister, ReservationId reservationId, String queueName) throws Exception {
final ReservationListRequest listRequest = ReservationListRequest.newInstance(queueName, reservationId.toString(), -1, -1, false);
ApplicationClientProtocol ownerClient = getRMClientForUser(lister);
return ownerClient.listReservations(listRequest);
}
Aggregations