|
@@ -19,11 +19,14 @@
|
|
|
package org.apache.hadoop.yarn.server.applicationhistoryservice;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.util.Collection;
|
|
|
import java.util.EnumSet;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
@@ -249,6 +252,7 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
|
|
|
FinalApplicationStatus finalStatus = FinalApplicationStatus.UNDEFINED;
|
|
|
YarnApplicationState state = YarnApplicationState.ACCEPTED;
|
|
|
ApplicationResourceUsageReport appResources = null;
|
|
|
+ Set<String> appTags = null;
|
|
|
Map<ApplicationAccessType, String> appViewACLs =
|
|
|
new HashMap<ApplicationAccessType, String>();
|
|
|
Map<String, Object> entityInfo = entity.getOtherInfo();
|
|
@@ -270,7 +274,7 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
|
|
|
ConverterUtils.toApplicationId(entity.getEntityId()),
|
|
|
latestApplicationAttemptId, user, queue, name, null, -1, null, state,
|
|
|
diagnosticsInfo, null, createdTime, finishedTime, finalStatus, null,
|
|
|
- null, progress, type, null), appViewACLs);
|
|
|
+ null, progress, type, null, appTags), appViewACLs);
|
|
|
}
|
|
|
if (entityInfo.containsKey(ApplicationMetricsConstants.QUEUE_ENTITY_INFO)) {
|
|
|
queue =
|
|
@@ -295,6 +299,17 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
|
|
|
appResources=ApplicationResourceUsageReport
|
|
|
.newInstance(0, 0, null, null, null, memorySeconds, vcoreSeconds);
|
|
|
}
|
|
|
+ if (entityInfo.containsKey(ApplicationMetricsConstants.APP_TAGS_INFO)) {
|
|
|
+ appTags = new HashSet<String>();
|
|
|
+ Object obj = entityInfo.get(ApplicationMetricsConstants.APP_TAGS_INFO);
|
|
|
+ if (obj != null && obj instanceof Collection<?>) {
|
|
|
+ for(Object o : (Collection<?>)obj) {
|
|
|
+ if (o != null) {
|
|
|
+ appTags.add(o.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
List<TimelineEvent> events = entity.getEvents();
|
|
|
if (events != null) {
|
|
@@ -347,7 +362,7 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
|
|
|
ConverterUtils.toApplicationId(entity.getEntityId()),
|
|
|
latestApplicationAttemptId, user, queue, name, null, -1, null, state,
|
|
|
diagnosticsInfo, null, createdTime, finishedTime, finalStatus, appResources,
|
|
|
- null, progress, type, null), appViewACLs);
|
|
|
+ null, progress, type, null, appTags), appViewACLs);
|
|
|
}
|
|
|
|
|
|
private static ApplicationAttemptReport convertToApplicationAttemptReport(
|