/** * @return all applications that is known to the * {@link AllocationTagsManager}, along with their application tags. * The result is a map, where key is an application ID, and value is the * application-tags attached to this application. If there is no * application-tag exists for the application, the value is an empty set. */ private Map<ApplicationId, Set<String>> getApplicationIdToTags() { Map<ApplicationId, Set<String>> result = new HashMap<>(); ConcurrentMap<ApplicationId, RMApp> allApps = rmContext.getRMApps(); if (allApps != null) { for (Map.Entry<ApplicationId, RMApp> app : allApps.entrySet()) { if (perAppNodeMappings.containsKey(app.getKey())) { result.put(app.getKey(), app.getValue().getApplicationTags()); } } } return result; } }
for (String tag : app.getApplicationTags()) { String[] parts = tag.split(":", 2); if (parts.length != 2 || parts[1].isEmpty()) {
Set<String> appTags = application.getApplicationTags(); if (appTags == null || appTags.isEmpty()) { continue;
Set<String> appTags = application.getApplicationTags(); if (appTags == null || appTags.isEmpty()) { continue;
Set<String> appTags = application.getApplicationTags(); if (appTags == null || appTags.isEmpty()) { continue;
for (String tag : app.getApplicationTags()) { String[] parts = tag.split(":", 2); if (parts.length != 2 || parts[1].isEmpty()) {
new RMAppMetrics(Resource.newInstance(0, 0), 0, 0, resourceSecondsMap, new HashMap<>())); when(app.getApplicationTags()).thenReturn(Collections.<String>emptySet()); ApplicationSubmissionContext appSubmissionContext = mock(ApplicationSubmissionContext.class);
new RMAppMetrics(Resource.newInstance(0, 0), 0, 0, resourceMap, preemptedMap)); when(rmApp.getApplicationTags()).thenReturn( Collections.<String> emptySet()); ApplicationSubmissionContext appSubmissionContext =
appTags.add("test"); appTags.add("tags"); when(app.getApplicationTags()).thenReturn(appTags); ApplicationSubmissionContext asc = mock(ApplicationSubmissionContext.class); when(asc.getUnmanagedAM()).thenReturn(false);
app.getSubmitTime()); entityInfo.put(ApplicationMetricsConstants.APP_TAGS_INFO, app.getApplicationTags()); entityInfo.put( ApplicationMetricsConstants.UNMANAGED_APPLICATION_ENTITY_INFO,
app.getSubmitTime()); entityInfo.put(ApplicationMetricsConstants.APP_TAGS_INFO, app.getApplicationTags()); entityInfo.put( ApplicationMetricsConstants.UNMANAGED_APPLICATION_ENTITY_INFO,
this.diagnostics = ""; if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) { this.applicationTags = Joiner.on(',').join(app.getApplicationTags());
this.diagnostics = ""; if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) { this.applicationTags = Joiner.on(',').join(app.getApplicationTags());
this.diagnostics = ""; if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) { this.applicationTags = Joiner.on(',').join(app.getApplicationTags());
entity.getOtherInfo().get( ApplicationMetricsConstants.SUBMITTED_TIME_ENTITY_INFO)); Assert.assertTrue(verifyAppTags(app.getApplicationTags(), entity.getOtherInfo())); if (i == 1) {
assertEquals(tags, app.getApplicationTags()); ContainerLaunchContext ctx = app.getApplicationSubmissionContext().getAMContainerSpec();
assertEquals(tags, app.getApplicationTags()); ContainerLaunchContext ctx = app.getApplicationSubmissionContext().getAMContainerSpec();