You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by va...@apache.org on 2017/03/30 20:34:13 UTC
hadoop git commit: YARN-6342. Make TimelineV2Client's drain timeout
after stop configurable (Haibo Chen via Varun Saxena)
Repository: hadoop
Updated Branches:
refs/heads/trunk 1309c585f -> 7c2bc444b
YARN-6342. Make TimelineV2Client's drain timeout after stop configurable (Haibo Chen via Varun Saxena)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7c2bc444
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7c2bc444
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7c2bc444
Branch: refs/heads/trunk
Commit: 7c2bc444b3d6750aafeed9b530c8e5b1bf95c1f4
Parents: 1309c58
Author: Varun Saxena <va...@apache.org>
Authored: Fri Mar 31 02:02:57 2017 +0530
Committer: Varun Saxena <va...@apache.org>
Committed: Fri Mar 31 02:02:57 2017 +0530
----------------------------------------------------------------------
.../org/apache/hadoop/yarn/conf/YarnConfiguration.java | 10 ++++++++++
.../hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java | 9 ++++++---
.../src/main/resources/yarn-default.xml | 9 +++++++++
3 files changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c2bc444/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
----------------------------------------------------------------------
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 c239249..81cb8c6 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
@@ -2095,6 +2095,16 @@ public class YarnConfiguration extends Configuration {
public static final int DEFAULT_NUMBER_OF_ASYNC_ENTITIES_TO_MERGE = 10;
+
+ /**
+ * The time period for which timeline v2 client will wait for draining
+ * leftover entities after stop.
+ */
+ public static final String TIMELINE_V2_CLIENT_DRAIN_TIME_MILLIS =
+ TIMELINE_SERVICE_CLIENT_PREFIX + "drain-entities.timeout.ms";
+ public static final long DEFAULT_TIMELINE_V2_CLIENT_DRAIN_TIME_MILLIS
+ = 2000L;
+
// mark app-history related configs @Private as application history is going
// to be integrated into the timeline service
@Private
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c2bc444/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
index cef7e5f..5d88f70 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
@@ -289,7 +289,7 @@ public class TimelineV2ClientImpl extends TimelineV2Client {
* Time period for which the timelineclient will wait for draining after
* stop.
*/
- private static final long DRAIN_TIME_PERIOD = 2000L;
+ private final long drainTimeoutPeriod;
private int numberOfAsyncsToMerge;
private final BlockingQueue<EntitiesHolder> timelineEntityQueue;
@@ -300,6 +300,9 @@ public class TimelineV2ClientImpl extends TimelineV2Client {
numberOfAsyncsToMerge =
conf.getInt(YarnConfiguration.NUMBER_OF_ASYNC_ENTITIES_TO_MERGE,
YarnConfiguration.DEFAULT_NUMBER_OF_ASYNC_ENTITIES_TO_MERGE);
+ drainTimeoutPeriod = conf.getLong(
+ YarnConfiguration.TIMELINE_V2_CLIENT_DRAIN_TIME_MILLIS,
+ YarnConfiguration.DEFAULT_TIMELINE_V2_CLIENT_DRAIN_TIME_MILLIS);
}
Runnable createRunnable() {
@@ -330,7 +333,7 @@ public class TimelineV2ClientImpl extends TimelineV2Client {
// Try to drain the remaining entities to be published @ the max for
// 2 seconds
long timeTillweDrain =
- System.currentTimeMillis() + DRAIN_TIME_PERIOD;
+ System.currentTimeMillis() + drainTimeoutPeriod;
while (!timelineEntityQueue.isEmpty()) {
publishWithoutBlockingOnQueue(timelineEntityQueue.poll());
if (System.currentTimeMillis() > timeTillweDrain) {
@@ -449,7 +452,7 @@ public class TimelineV2ClientImpl extends TimelineV2Client {
LOG.info("Stopping TimelineClient.");
executor.shutdownNow();
try {
- executor.awaitTermination(DRAIN_TIME_PERIOD, TimeUnit.MILLISECONDS);
+ executor.awaitTermination(drainTimeoutPeriod, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
e.printStackTrace();
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c2bc444/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
----------------------------------------------------------------------
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 727e2c9..bdd4de5 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
@@ -2102,6 +2102,15 @@
</property>
<property>
+ <description>
+ The time period for which timeline v2 client will wait for draining
+ leftover entities after stop.
+ </description>
+ <name>yarn.timeline-service.client.drain-entities.timeout.ms</name>
+ <value>2000</value>
+ </property>
+
+ <property>
<description>Enable timeline server to recover state after starting. If
true, then yarn.timeline-service.state-store-class must be specified.
</description>
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org