diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
index f7f82f8adc7..672307081b3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
@@ -2664,6 +2664,15 @@ public static boolean isAclEnabled(Configuration conf) {
public static final String TIMELINE_SERVICE_READ_AUTH_ENABLED =
TIMELINE_SERVICE_PREFIX + "read.authentication.enabled";
+ /**
+ * The name for setting that controls how often aggregation is kicked off
+ * in timeline collector.
+ */
+ public static final String TIMELINE_SERVICE_AGGREGATION_INTERVAL_SECS =
+ TIMELINE_SERVICE_PREFIX + "aggregation-interval-secs";
+
+ public static final int
+ DEFAULT_TIMELINE_SERVICE_AGGREGATION_INTERVAL_SECS = 15;
/**
* The default setting for authentication checks for reading timeline
* service v2 data.
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
index b0ffc48e1e6..b6b47dc2ee3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
@@ -2545,6 +2545,15 @@
259200000
+
+
+ The setting that controls how often aggregation is kicked off
+ in timeline collector.
+
+ yarn.timeline-service.aggregation-interval-secs
+ 15
+
+
The default hdfs location for flowrun coprocessor jar.
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollectorWithAgg.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollectorWithAgg.java
index d7f47c894e3..aa041a524dc 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollectorWithAgg.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollectorWithAgg.java
@@ -25,6 +25,7 @@
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntities;
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity;
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType;
+import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
@@ -50,7 +51,7 @@
LoggerFactory.getLogger(TimelineCollector.class);
private final static int AGGREGATION_EXECUTOR_NUM_THREADS = 1;
- private final static int AGGREGATION_EXECUTOR_EXEC_INTERVAL_SECS = 15;
+ private int aggregationExecutorIntervalSecs;
private static Set entityTypesSkipAggregation
= initializeSkipSet();
@@ -71,6 +72,11 @@ public AppLevelTimelineCollectorWithAgg(ApplicationId appId, String user) {
@Override
protected void serviceInit(Configuration conf) throws Exception {
+ aggregationExecutorIntervalSecs = conf.getInt(
+ YarnConfiguration.TIMELINE_SERVICE_AGGREGATION_INTERVAL_SECS,
+ YarnConfiguration.
+ DEFAULT_TIMELINE_SERVICE_AGGREGATION_INTERVAL_SECS
+ );
super.serviceInit(conf);
}
@@ -84,10 +90,8 @@ protected void serviceStart() throws Exception {
.build());
appAggregator = new AppLevelAggregator();
appAggregationExecutor.scheduleAtFixedRate(appAggregator,
- AppLevelTimelineCollectorWithAgg.
- AGGREGATION_EXECUTOR_EXEC_INTERVAL_SECS,
- AppLevelTimelineCollectorWithAgg.
- AGGREGATION_EXECUTOR_EXEC_INTERVAL_SECS,
+ aggregationExecutorIntervalSecs,
+ aggregationExecutorIntervalSecs,
TimeUnit.SECONDS);
super.serviceStart();
}