ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-19192 Use released Helix 0.6.6 instead of 0.7.1 beta as AMS dependency (dsen)
Date Tue, 27 Dec 2016 17:49:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk f36cf27b1 -> 20c7940a1


AMBARI-19192 Use released Helix 0.6.6 instead of 0.7.1 beta as AMS dependency (dsen)


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

Branch: refs/heads/trunk
Commit: 20c7940a150c260535d34f70431db0633a628272
Parents: f36cf27
Author: Dmytro Sen <dsen@apache.org>
Authored: Tue Dec 27 19:49:37 2016 +0200
Committer: Dmytro Sen <dsen@apache.org>
Committed: Tue Dec 27 19:49:37 2016 +0200

----------------------------------------------------------------------
 .../ambari-metrics-timelineservice/pom.xml         | 16 ++++++++--------
 .../availability/AggregationTaskRunner.java        |  5 ++---
 .../availability/MetricCollectorHAController.java  |  3 ++-
 .../OnlineOfflineStateModelFactory.java            | 17 ++++++++---------
 .../MetricCollectorHAControllerTest.java           |  3 +--
 5 files changed, 21 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/20c7940a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index 84290b2..9d269e7 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -293,21 +293,21 @@
     <dependency>
       <groupId>org.apache.helix</groupId>
       <artifactId>helix-core</artifactId>
-      <version>0.7.1</version>
+      <version>0.6.6</version>
       <exclusions>
+        <!-- zkclient is helix-core dependency but it need to be 0.9 in order for AMS
HA to work on secure cluster-->
         <exclusion>
-          <artifactId>zookeeper</artifactId>
-          <groupId>org.apache.zookeeper</groupId>
+          <artifactId>zkclient</artifactId>
+          <groupId>com.101tec</groupId>
         </exclusion>
       </exclusions>
     </dependency>
-
+    <!-- zkclient is helix-core dependency but it need to be 0.9 in order for AMS HA to
work on secure cluster-->
     <dependency>
-      <artifactId>zookeeper</artifactId>
-      <groupId>org.apache.zookeeper</groupId>
-      <version>3.4.8</version>
+      <groupId>com.101tec</groupId>
+      <artifactId>zkclient</artifactId>
+      <version>0.9</version>
     </dependency>
-
     <dependency>
       <groupId>org.apache.phoenix</groupId>
       <artifactId>phoenix-core</artifactId>

http://git-wip-us.apache.org/repos/asf/ambari/blob/20c7940a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/AggregationTaskRunner.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/AggregationTaskRunner.java
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/AggregationTaskRunner.java
index ceab754..9a92d41 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/AggregationTaskRunner.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/AggregationTaskRunner.java
@@ -23,7 +23,6 @@ import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.
 import org.apache.helix.HelixManager;
 import org.apache.helix.HelixManagerFactory;
 import org.apache.helix.InstanceType;
-import org.apache.helix.api.id.StateModelDefId;
 import org.apache.helix.participant.StateMachineEngine;
 
 import java.util.HashMap;
@@ -95,7 +94,7 @@ public class AggregationTaskRunner {
       new OnlineOfflineStateModelFactory(instanceName, this);
 
     StateMachineEngine stateMach = manager.getStateMachineEngine();
-    stateMach.registerStateModelFactory(StateModelDefId.from(DEFAULT_STATE_MODEL), stateModelFactory);
+    stateMach.registerStateModelFactory(DEFAULT_STATE_MODEL, stateModelFactory);
     manager.connect();
 
     checkpointManager = new CheckpointManager(manager.getHelixPropertyStore());
@@ -143,4 +142,4 @@ public class AggregationTaskRunner {
   void stop() {
     manager.disconnect();
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/20c7940a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAController.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAController.java
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAController.java
index 26702b6..12c255e 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAController.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAController.java
@@ -33,6 +33,7 @@ import org.apache.helix.manager.zk.ZKHelixAdmin;
 import org.apache.helix.model.ExternalView;
 import org.apache.helix.model.InstanceConfig;
 import org.apache.helix.model.LiveInstance;
+import org.apache.helix.model.OnlineOfflineSMD;
 import org.apache.helix.model.StateModelDefinition;
 import org.apache.helix.tools.StateModelConfigGenerator;;
 import java.util.ArrayList;
@@ -49,7 +50,7 @@ public class MetricCollectorHAController {
 
   static final String CLUSTER_NAME = "ambari-metrics-cluster";
   static final String METRIC_AGGREGATORS = "METRIC_AGGREGATORS";
-  static final String DEFAULT_STATE_MODEL = "OnlineOffline";
+  static final String DEFAULT_STATE_MODEL = OnlineOfflineSMD.name;
   static final String INSTANCE_NAME_DELIMITER = "_";
 
   final String zkConnectUrl;

http://git-wip-us.apache.org/repos/asf/ambari/blob/20c7940a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/OnlineOfflineStateModelFactory.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/OnlineOfflineStateModelFactory.java
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/OnlineOfflineStateModelFactory.java
index eb63327..3486c4d 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/OnlineOfflineStateModelFactory.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/OnlineOfflineStateModelFactory.java
@@ -21,14 +21,13 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineMetricAggregator.AGGREGATOR_TYPE;
 import org.apache.helix.NotificationContext;
-import org.apache.helix.api.StateTransitionHandlerFactory;
-import org.apache.helix.api.TransitionHandler;
-import org.apache.helix.api.id.PartitionId;
 import org.apache.helix.model.Message;
+import org.apache.helix.participant.statemachine.StateModel;
+import org.apache.helix.participant.statemachine.StateModelFactory;
 
 import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.availability.AggregationTaskRunner.PARTITION_AGGREGATION_TYPES;
 
-public class OnlineOfflineStateModelFactory extends StateTransitionHandlerFactory<TransitionHandler>
{
+public class OnlineOfflineStateModelFactory extends StateModelFactory<StateModel> {
   private static final Log LOG = LogFactory.getLog(OnlineOfflineStateModelFactory.class);
   private final String instanceName;
   private final AggregationTaskRunner taskRunner;
@@ -39,13 +38,13 @@ public class OnlineOfflineStateModelFactory extends StateTransitionHandlerFactor
   }
 
   @Override
-  public TransitionHandler createStateTransitionHandler(PartitionId stateUnitKey) {
-    LOG.info("Received request to process partition = " + stateUnitKey.stringify()
-      + ", at " + instanceName);
+  public StateModel createNewStateModel(String resourceName, String partition) {
+    LOG.info("Received request to process partition = " + partition + ", for " +
+            "resource = " + resourceName + ", at " + instanceName);
     return new OnlineOfflineStateModel();
   }
 
-  public class OnlineOfflineStateModel extends TransitionHandler {
+  public class OnlineOfflineStateModel extends StateModel {
     public void onBecomeOnlineFromOffline(Message message, NotificationContext context) {
       String partitionName = message.getPartitionName();
       LOG.info("Received transition to Online from Offline for partition: " + partitionName);
@@ -67,4 +66,4 @@ public class OnlineOfflineStateModelFactory extends StateTransitionHandlerFactor
       taskRunner.unsetPartitionAggregationFunction(type);
     }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/20c7940a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAControllerTest.java
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAControllerTest.java
index 875f013..a0bc77f 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAControllerTest.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/availability/MetricCollectorHAControllerTest.java
@@ -23,7 +23,6 @@ import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.
 import org.apache.helix.HelixManager;
 import org.apache.helix.HelixManagerFactory;
 import org.apache.helix.InstanceType;
-import org.apache.helix.api.id.StateModelDefId;
 import org.apache.helix.model.ExternalView;
 import org.apache.helix.model.InstanceConfig;
 import org.junit.Before;
@@ -75,7 +74,7 @@ public class MetricCollectorHAControllerTest extends AbstractMiniHBaseClusterTes
     HelixManager manager2 = HelixManagerFactory.getZKHelixManager(CLUSTER_NAME,
       instanceConfig2.getInstanceName(),
       InstanceType.PARTICIPANT, haController.zkConnectUrl);
-    manager2.getStateMachineEngine().registerStateModelFactory(StateModelDefId.from(DEFAULT_STATE_MODEL),
+    manager2.getStateMachineEngine().registerStateModelFactory(DEFAULT_STATE_MODEL,
       new OnlineOfflineStateModelFactory(instanceConfig2.getInstanceName(),
         new AggregationTaskRunner(instanceConfig2.getInstanceName(), "", CLUSTER_NAME)));
     manager2.connect();


Mime
View raw message