From 461ee44d287b1fcf0bf15d662aebd3e6f2b83a72 Mon Sep 17 00:00:00 2001 From: Haibo Chen Date: Tue, 9 May 2017 21:10:18 -0700 Subject: [PATCH] YARN-6435. [ATSv2] Can't retrieve more than 1000 versions of metrics in time series. (Rohith Sharma K S via Haibo Chen) --- .../storage/application/ApplicationTable.java | 12 ++++++++++-- .../timelineservice/storage/entity/EntityTable.java | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/application/ApplicationTable.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/application/ApplicationTable.java index a02f768d6f..cb4fc92d75 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/application/ApplicationTable.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/application/ApplicationTable.java @@ -82,6 +82,13 @@ public class ApplicationTable extends BaseTable { private static final String METRICS_TTL_CONF_NAME = PREFIX + ".table.metrics.ttl"; + /** + * config param name that specifies max-versions for metrics column family in + * entity table. + */ + private static final String METRICS_MAX_VERSIONS = + PREFIX + ".table.metrics.max-versions"; + /** default value for application table name. */ private static final String DEFAULT_TABLE_NAME = "timelineservice.application"; @@ -90,7 +97,7 @@ public class ApplicationTable extends BaseTable { private static final int DEFAULT_METRICS_TTL = 2592000; /** default max number of versions. */ - private static final int DEFAULT_METRICS_MAX_VERSIONS = 1000; + private static final int DEFAULT_METRICS_MAX_VERSIONS = 10000; private static final Log LOG = LogFactory.getLog(ApplicationTable.class); @@ -136,7 +143,8 @@ public void createTable(Admin admin, Configuration hbaseConf) metricsCF.setBlockCacheEnabled(true); // always keep 1 version (the latest) metricsCF.setMinVersions(1); - metricsCF.setMaxVersions(DEFAULT_METRICS_MAX_VERSIONS); + metricsCF.setMaxVersions( + hbaseConf.getInt(METRICS_MAX_VERSIONS, DEFAULT_METRICS_MAX_VERSIONS)); metricsCF.setTimeToLive(hbaseConf.getInt(METRICS_TTL_CONF_NAME, DEFAULT_METRICS_TTL)); applicationTableDescp.setRegionSplitPolicyClassName( diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/entity/EntityTable.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/entity/EntityTable.java index b194f07fef..ddf0406c80 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/entity/EntityTable.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/entity/EntityTable.java @@ -83,6 +83,13 @@ public class EntityTable extends BaseTable { private static final String METRICS_TTL_CONF_NAME = PREFIX + ".table.metrics.ttl"; + /** + * config param name that specifies max-versions for metrics column family in + * entity table. + */ + private static final String METRICS_MAX_VERSIONS = + PREFIX + ".table.metrics.max-versions"; + /** default value for entity table name. */ public static final String DEFAULT_TABLE_NAME = "timelineservice.entity"; @@ -90,7 +97,7 @@ public class EntityTable extends BaseTable { private static final int DEFAULT_METRICS_TTL = 2592000; /** default max number of versions. */ - private static final int DEFAULT_METRICS_MAX_VERSIONS = 1000; + private static final int DEFAULT_METRICS_MAX_VERSIONS = 10000; private static final Log LOG = LogFactory.getLog(EntityTable.class); @@ -136,7 +143,8 @@ public void createTable(Admin admin, Configuration hbaseConf) metricsCF.setBlockCacheEnabled(true); // always keep 1 version (the latest) metricsCF.setMinVersions(1); - metricsCF.setMaxVersions(DEFAULT_METRICS_MAX_VERSIONS); + metricsCF.setMaxVersions( + hbaseConf.getInt(METRICS_MAX_VERSIONS, DEFAULT_METRICS_MAX_VERSIONS)); metricsCF.setTimeToLive(hbaseConf.getInt(METRICS_TTL_CONF_NAME, DEFAULT_METRICS_TTL)); entityTableDescp.setRegionSplitPolicyClassName(