@Override public ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException { GetApplicationReportRequest request = GetApplicationReportRequest .newInstance(appId); GetApplicationReportResponse response = ahsClient .getApplicationReport(request); return response.getApplicationReport(); }
@Override public ApplicationReport run() throws Exception { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); return appBaseProt.getApplicationReport(request).getApplicationReport(); } });
@Override public ApplicationReport run() throws Exception { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); return appBaseProt.getApplicationReport(request).getApplicationReport(); } });
@Override public ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException { GetApplicationReportRequest request = GetApplicationReportRequest .newInstance(appId); GetApplicationReportResponse response = ahsClient .getApplicationReport(request); return response.getApplicationReport(); }
@Override public ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException { GetApplicationReportRequest request = GetApplicationReportRequest .newInstance(appId); GetApplicationReportResponse response = ahsClient .getApplicationReport(request); return response.getApplicationReport(); }
@Override public ApplicationReport run() throws Exception { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); return appBaseProt.getApplicationReport(request).getApplicationReport(); } });
@Override public ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException { GetApplicationReportRequest request = GetApplicationReportRequest .newInstance(appId); GetApplicationReportResponse response = ahsClient .getApplicationReport(request); return response.getApplicationReport(); }
private static boolean isApplicationTerminated(ApplicationId appId, ApplicationClientProtocol rmClient) throws IOException { ApplicationReport appReport = null; try { appReport = rmClient.getApplicationReport( GetApplicationReportRequest.newInstance(appId)) .getApplicationReport(); } catch (ApplicationNotFoundException e) { return true; } catch (YarnException e) { throw new IOException(e); } YarnApplicationState currentState = appReport.getYarnApplicationState(); return currentState == YarnApplicationState.FAILED || currentState == YarnApplicationState.KILLED || currentState == YarnApplicationState.FINISHED; }
private static boolean isApplicationTerminated(ApplicationId appId, ApplicationClientProtocol rmClient) throws IOException { ApplicationReport appReport = null; try { appReport = rmClient.getApplicationReport( GetApplicationReportRequest.newInstance(appId)) .getApplicationReport(); } catch (ApplicationNotFoundException e) { return true; } catch (YarnException e) { throw new IOException(e); } YarnApplicationState currentState = appReport.getYarnApplicationState(); return currentState == YarnApplicationState.FAILED || currentState == YarnApplicationState.KILLED || currentState == YarnApplicationState.FINISHED; }
private static boolean isApplicationTerminated(ApplicationId appId, ApplicationClientProtocol rmClient) throws IOException { ApplicationReport appReport = null; try { appReport = rmClient.getApplicationReport( GetApplicationReportRequest.newInstance(appId)) .getApplicationReport(); } catch (ApplicationNotFoundException e) { return true; } catch (YarnException e) { throw new IOException(e); } YarnApplicationState currentState = appReport.getYarnApplicationState(); return currentState == YarnApplicationState.FAILED || currentState == YarnApplicationState.KILLED || currentState == YarnApplicationState.FINISHED; }
public ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException { ApplicationClientProtocol client = getClientRMService(); GetApplicationReportResponse response = client.getApplicationReport(GetApplicationReportRequest .newInstance(appId)); return response.getApplicationReport(); }
public ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException { ApplicationClientProtocol client = getClientRMService(); GetApplicationReportResponse response = client.getApplicationReport(GetApplicationReportRequest .newInstance(appId)); return response.getApplicationReport(); }
@Test public void testApplicationNotFound() throws IOException, YarnException { ApplicationId appId = null; appId = ApplicationId.newInstance(0, MAX_APPS + 1); GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(appId); try { @SuppressWarnings("unused") GetApplicationReportResponse response = clientService.getApplicationReport(request); Assert.fail("Exception should have been thrown before we reach here."); } catch (ApplicationNotFoundException e) { //This exception is expected. Assert.assertTrue(e.getMessage().contains( "doesn't exist in the timeline store")); } catch (Exception e) { Assert.fail("Undesired exception caught"); } }
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."); } }
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()); }
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()); }
@Test public void testApplicationReport() throws IOException, YarnException { ApplicationId appId = null; appId = ApplicationId.newInstance(0, 1); GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(appId); GetApplicationReportResponse response = clientService.getApplicationReport(request); ApplicationReport appReport = response.getApplicationReport(); Assert.assertNotNull(appReport); Assert.assertEquals(123, appReport.getApplicationResourceUsageReport() .getMemorySeconds()); Assert.assertEquals(345, appReport.getApplicationResourceUsageReport() .getVcoreSeconds()); Assert.assertEquals("application_0_0001", appReport.getApplicationId() .toString()); Assert.assertEquals("test app type", appReport.getApplicationType().toString()); Assert.assertEquals("test queue", appReport.getQueue().toString()); }
@Test(timeout = 60000) public void testUnManagedRMRestart() throws Exception { // Create RM MockRM rm1 = createMockRM(conf); MemoryRMStateStore memStore = (MemoryRMStateStore) rm1.getRMStateStore(); rm1.start(); // create app and launch the AM RMApp app0 = rm1.submitApp(null, "name", "user", new HashMap<>(), true, "default"); rm1.killApp(app0.getApplicationId()); rm1.waitForState(app0.getApplicationId(), RMAppState.KILLED); // start new RM MockRM rm2 = createMockRM(conf, memStore); rm2.start(); Assert.assertEquals(1, rm2.getRMContext().getRMApps().size()); ApplicationReport appReport = rm2.getClientRMService().getApplicationReport( GetApplicationReportRequest.newInstance(app0.getApplicationId())) .getApplicationReport(); Assert.assertEquals(true, appReport.isUnmanagedApp()); rm1.stop(); rm2.stop(); }
private ApplicationReport verifyAppReportAfterRMRestart(RMApp app, MockRM rm) throws Exception { GetApplicationReportRequest reportRequest = GetApplicationReportRequest.newInstance(app.getApplicationId()); GetApplicationReportResponse response = rm.getClientRMService().getApplicationReport(reportRequest); ApplicationReport report = response.getApplicationReport(); Assert.assertEquals(app.getStartTime(), report.getStartTime()); Assert.assertEquals(app.getFinishTime(), report.getFinishTime()); Assert.assertEquals(app.createApplicationState(), report.getYarnApplicationState()); Assert.assertTrue(1 == report.getProgress()); return response.getApplicationReport(); }
private ApplicationReport verifyAppReportAfterRMRestart(RMApp app, MockRM rm) throws Exception { GetApplicationReportRequest reportRequest = GetApplicationReportRequest.newInstance(app.getApplicationId()); GetApplicationReportResponse response = rm.getClientRMService().getApplicationReport(reportRequest); ApplicationReport report = response.getApplicationReport(); Assert.assertEquals(app.getStartTime(), report.getStartTime()); Assert.assertEquals(app.getFinishTime(), report.getFinishTime()); Assert.assertEquals(app.createApplicationState(), report.getYarnApplicationState()); Assert.assertTrue(1 == report.getProgress()); return response.getApplicationReport(); }