Repository: ambari
Updated Branches:
  refs/heads/branch-metrics-dev 1d8179543 -> 8dd2fc2af


AMBARI-5707. Disable LevelDBTimelineStore for AMS - collector. (swagle)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8dd2fc2a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8dd2fc2a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8dd2fc2a

Branch: refs/heads/branch-metrics-dev
Commit: 8dd2fc2af0e3d56c69d855e131428b56f5637915
Parents: 1d81795
Author: Siddharth Wagle <swa...@hortonworks.com>
Authored: Tue Nov 25 10:28:34 2014 -0800
Committer: Siddharth Wagle <swa...@hortonworks.com>
Committed: Tue Nov 25 10:28:34 2014 -0800

----------------------------------------------------------------------
 .../ApplicationHistoryManagerImpl.java                   |  7 +++++++
 .../ApplicationHistoryServer.java                        | 11 +++++++++--
 .../metrics/timeline/TimelineMetricConfiguration.java    |  2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8dd2fc2a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
----------------------------------------------------------------------
diff --git 
a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
 
b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
index ad29320..85a5e3a 100644
--- 
a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
+++ 
b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
@@ -39,10 +39,13 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationHistoryData;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerHistoryData;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.MemoryTimelineStore;
 import org.apache.hadoop.yarn.webapp.util.WebAppUtils;
 
 import com.google.common.annotations.VisibleForTesting;
 
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.DISABLE_APPLICATION_TIMELINE_STORE;
+
 public class ApplicationHistoryManagerImpl extends AbstractService implements
     ApplicationHistoryManager {
   private static final Log LOG = LogFactory
@@ -82,6 +85,10 @@ public class ApplicationHistoryManagerImpl extends 
AbstractService implements
 
   protected ApplicationHistoryStore createApplicationHistoryStore(
       Configuration conf) {
+    if (conf.getBoolean(DISABLE_APPLICATION_TIMELINE_STORE, true)) {
+      LOG.info("Explicitly disabled application timeline store.");
+      return new NullApplicationHistoryStore();
+    }
     return ReflectionUtils.newInstance(conf.getClass(
       YarnConfiguration.APPLICATION_HISTORY_STORE,
       NullApplicationHistoryStore.class,

http://git-wip-us.apache.org/repos/asf/ambari/blob/8dd2fc2a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
----------------------------------------------------------------------
diff --git 
a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
 
b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
index f622153..3adb3b8 100644
--- 
a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
+++ 
b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
@@ -34,7 +34,9 @@ import org.apache.hadoop.yarn.YarnUncaughtExceptionHandler;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.HBaseTimelineMetricStore;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricStore;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.MemoryTimelineStore;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.TimelineStore;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.LeveldbTimelineStore;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.AHSWebApp;
@@ -44,6 +46,8 @@ import org.apache.hadoop.yarn.webapp.util.WebAppUtils;
 
 import com.google.common.annotations.VisibleForTesting;
 
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.*;
+
 /**
  * History server that keeps track of all types of history in the cluster.
  * Application specific history to start with.
@@ -146,8 +150,11 @@ public class ApplicationHistoryServer extends 
CompositeService {
     return new ApplicationHistoryManagerImpl();
   }
 
-  protected TimelineStore createTimelineStore(
-      Configuration conf) {
+  protected TimelineStore createTimelineStore(Configuration conf) {
+    if (conf.getBoolean(DISABLE_APPLICATION_TIMELINE_STORE, true)) {
+      LOG.info("Explicitly disabled application timeline store.");
+      return new MemoryTimelineStore();
+    }
     return ReflectionUtils.newInstance(conf.getClass(
         YarnConfiguration.TIMELINE_SERVICE_STORE, LeveldbTimelineStore.class,
         TimelineStore.class), conf);

http://git-wip-us.apache.org/repos/asf/ambari/blob/8dd2fc2a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
----------------------------------------------------------------------
diff --git 
a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
 
b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
index e022e5e..d17b1e4 100644
--- 
a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
+++ 
b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
@@ -104,4 +104,6 @@ public interface TimelineMetricConfiguration {
   public static final String CLUSTER_AGGREGATOR_HOUR_DISABLED =
     "timeline.metrics.cluster.aggregator.hourly.disabled";
 
+  public static final String DISABLE_APPLICATION_TIMELINE_STORE =
+    "timeline.service.disable.application.timeline.store";
 }

Reply via email to