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());
  }
Beispiel #2
0
 @Override
 public ApplicationReport getApplicationReport(ApplicationId appId)
     throws YarnException, IOException {
   GetApplicationReportResponse response = null;
   try {
     GetApplicationReportRequest request = Records.newRecord(GetApplicationReportRequest.class);
     request.setApplicationId(appId);
     response = rmClient.getApplicationReport(request);
   } catch (YarnException e) {
     if (!historyServiceEnabled) {
       // Just throw it as usual if historyService is not enabled.
       throw e;
     }
     // Even if history-service is enabled, treat all exceptions still the same
     // except the following
     if (!(e.getClass() == ApplicationNotFoundException.class)) {
       throw e;
     }
     return historyClient.getApplicationReport(appId);
   }
   return response.getApplicationReport();
 }