@Override public ContainerReport run() throws Exception { ContainerReport report = null; if (request.getContainerId() != null) { try { report = appBaseProt.getContainerReport(request) .getContainerReport(); } catch (ContainerNotFoundException ex) { LOG.warn(ex.getMessage()); } } return report; } });
@Override public ContainerReport getContainer(ContainerId containerId) throws YarnException, IOException { ApplicationReportExt app = getApplication( containerId.getApplicationAttemptId().getApplicationId(), ApplicationReportField.USER_AND_ACLS); checkAccess(app); TimelineEntity entity = timelineDataManager.getEntity( ContainerMetricsConstants.ENTITY_TYPE, containerId.toString(), EnumSet.allOf(Field.class), UserGroupInformation.getLoginUser()); if (entity == null) { throw new ContainerNotFoundException( "The entity for container " + containerId + " doesn't exist in the timeline store"); } else { return convertToContainerReport( entity, serverHttpAddress, app.appReport.getUser()); } }
@Override public ContainerReport getContainer(ContainerId containerId) throws YarnException, IOException { ApplicationReportExt app = getApplication( containerId.getApplicationAttemptId().getApplicationId(), ApplicationReportField.USER_AND_ACLS); checkAccess(app); TimelineEntity entity = timelineDataManager.getEntity( ContainerMetricsConstants.ENTITY_TYPE, containerId.toString(), EnumSet.allOf(Field.class), UserGroupInformation.getLoginUser()); if (entity == null) { throw new ContainerNotFoundException( "The entity for container " + containerId + " doesn't exist in the timeline store"); } else { return convertToContainerReport( entity, serverHttpAddress, app.appReport.getUser()); } }
@Override public ContainerReport getContainer(ContainerId containerId) throws YarnException, IOException { ApplicationReportExt app = getApplication( containerId.getApplicationAttemptId().getApplicationId(), ApplicationReportField.USER_AND_ACLS); checkAccess(app); TimelineEntity entity = timelineDataManager.getEntity( ContainerMetricsConstants.ENTITY_TYPE, containerId.toString(), EnumSet.allOf(Field.class), UserGroupInformation.getLoginUser()); if (entity == null) { throw new ContainerNotFoundException( "The entity for container " + containerId + " doesn't exist in the timeline store"); } else { return convertToContainerReport( entity, serverHttpAddress, app.appReport.getUser()); } }
@Override public ContainerReport run() throws Exception { ContainerReport report = null; if (request.getContainerId() != null) { try { report = appBaseProt.getContainerReport(request) .getContainerReport(); } catch (ContainerNotFoundException ex) { LOG.warn(ex.getMessage()); } } return report; } });
containerId); if (rmConatiner == null) { throw new ContainerNotFoundException("Container with id '" + containerId + "' doesn't exist in RM.");
@Override public ContainerReport run() throws Exception { ContainerReport report = null; if (request.getContainerId() != null) { try { report = appBaseProt.getContainerReport(request) .getContainerReport(); } catch (ContainerNotFoundException ex) { LOG.warn(ex.getMessage()); } } return report; } });
containerId); if (rmConatiner == null) { throw new ContainerNotFoundException("Container with id '" + containerId + "' doesn't exist in RM.");
@Test public void testContainerNotFound() throws IOException, YarnException { ApplicationId appId = ApplicationId.newInstance(0, 1); ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, 1); ContainerId containerId = ContainerId.newContainerId(appAttemptId, MAX_APPS + 1); GetContainerReportRequest request = GetContainerReportRequest.newInstance(containerId); try { @SuppressWarnings("unused") GetContainerReportResponse response = clientService.getContainerReport(request); } catch (ContainerNotFoundException 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"); } }
containerId); if (rmContainer == null) { throw new ContainerNotFoundException("Container with id '" + containerId + "' doesn't exist in RM.");