ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [04/12] AMBARI-4072. Remove extraneous jmx and ganglia files (ncole)
Date Mon, 16 Dec 2013 13:28:42 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/eb80c2b7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersioningPropertyProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersioningPropertyProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersioningPropertyProviderTest.java
deleted file mode 100644
index 1db4e0b..0000000
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersioningPropertyProviderTest.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.controller.internal;
-
-import org.apache.ambari.server.controller.jmx.JMXPropertyProvider;
-import org.apache.ambari.server.controller.spi.Predicate;
-import org.apache.ambari.server.controller.spi.Request;
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.SystemException;
-import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * VersioningPropertyProvider Tests
- */
-public class VersioningPropertyProviderTest {
-  @Test
-  public void testPopulateResources() throws Exception {
-
-    Map<String, PropertyHelper.MetricsVersion> clusterVersionsMap =
-        new HashMap<String, PropertyHelper.MetricsVersion>();
-
-    clusterVersionsMap.put("c1", PropertyHelper.MetricsVersion.HDP1);
-    clusterVersionsMap.put("c2", PropertyHelper.MetricsVersion.HDP2);
-
-    Map<PropertyHelper.MetricsVersion, AbstractPropertyProvider> providers =
-        new HashMap<PropertyHelper.MetricsVersion, AbstractPropertyProvider>();
-
-    TestJMXPropertyProvider propertyProvider1 = new TestJMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-    providers.put(PropertyHelper.MetricsVersion.HDP1, propertyProvider1);
-
-
-    TestJMXPropertyProvider propertyProvider2 = new TestJMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    providers.put(PropertyHelper.MetricsVersion.HDP2, propertyProvider2);
-
-    // set propertyProvider2 as the default provider
-    VersioningPropertyProvider provider = new VersioningPropertyProvider(clusterVersionsMap, providers,
-        propertyProvider2, PropertyHelper.getPropertyId("HostRoles", "cluster_name"));
-
-
-    Request request = PropertyHelper.getReadRequest();
-
-    Resource resource1 = new ResourceImpl(Resource.Type.HostComponent);
-    resource1.setProperty(PropertyHelper.getPropertyId("HostRoles", "cluster_name"), "c1");
-
-
-    provider.populateResources(Collections.singleton(resource1), request, null);
-
-    Assert.assertEquals(resource1, propertyProvider1.getResource());
-    Assert.assertNull(propertyProvider2.getResource());
-
-    propertyProvider1.setResource(null);
-    propertyProvider2.setResource(null);
-
-    Resource resource2 = new ResourceImpl(Resource.Type.HostComponent);
-    resource2.setProperty(PropertyHelper.getPropertyId("HostRoles", "cluster_name"), "c2");
-
-    provider.populateResources(Collections.singleton(resource2), request, null);
-
-    Assert.assertNull(propertyProvider1.getResource());
-    Assert.assertEquals(resource2, propertyProvider2.getResource());
-
-    propertyProvider1.setResource(null);
-    propertyProvider2.setResource(null);
-
-    Set<Resource> resources = new HashSet<Resource>();
-    resources.add(resource1);
-    resources.add(resource2);
-
-    provider.populateResources(resources, request, null);
-
-    Assert.assertEquals(resource1, propertyProvider1.getResource());
-    Assert.assertEquals(resource2, propertyProvider2.getResource());
-
-
-    // test resource with no associated cluster ... should go to default provider2
-    propertyProvider1.setResource(null);
-    propertyProvider2.setResource(null);
-
-    Resource resource3 = new ResourceImpl(Resource.Type.HostComponent);
-
-    provider.populateResources(Collections.singleton(resource3), request, null);
-
-    Assert.assertNull(propertyProvider1.getResource());
-    Assert.assertEquals(resource3, propertyProvider2.getResource());
-  }
-
-  private class TestJMXPropertyProvider extends JMXPropertyProvider {
-
-    private Resource resource = null;
-
-
-    public TestJMXPropertyProvider(Map<String, Map<String, PropertyInfo>> componentMetrics,
-                                   String clusterNamePropertyId,
-                                   String hostNamePropertyId,
-                                   String componentNamePropertyId,
-                                   String statePropertyId,
-                                   Set<String> healthyStates) {
-
-      super(componentMetrics, null, null, clusterNamePropertyId, hostNamePropertyId,
-          componentNamePropertyId, statePropertyId, healthyStates);
-    }
-
-    public Resource getResource() {
-      return resource;
-    }
-
-    public void setResource(Resource resource) {
-      this.resource = resource;
-    }
-
-    @Override
-    public Set<Resource> populateResources(Set<Resource> resources, Request request, Predicate predicate) throws SystemException {
-
-      if (resources.size() == 1) {
-        resource = resources.iterator().next();
-      }
-      return resources;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb80c2b7/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
index d6ebda3..c2910db 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
@@ -50,7 +50,7 @@ public class JMXPropertyProviderTest {
     TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
 
     JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent),
         streamProvider,
         hostProvider,
         PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
@@ -236,7 +236,7 @@ public class JMXPropertyProviderTest {
     TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
 
     JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent),
         streamProvider,
         hostProvider,
         PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
@@ -271,7 +271,7 @@ public class JMXPropertyProviderTest {
     TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
 
     JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent),
         streamProvider,
         hostProvider,
         PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
@@ -308,7 +308,7 @@ public class JMXPropertyProviderTest {
     TestJMXHostProvider hostProvider = new TestJMXHostProvider(true);
 
     JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent),
         streamProvider,
         hostProvider,
         PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
@@ -339,253 +339,8 @@ public class JMXPropertyProviderTest {
     Assert.assertEquals(23634400, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "NonHeapMemoryUsed")));
   }
 
-  @Test
-  public void testPopulateResources_HDP2() throws Exception {
-    TestStreamProvider  streamProvider = new TestStreamProvider();
-    TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
-
-    JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        streamProvider,
-        hostProvider,
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    // resourcemanager
-    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
-
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "domu-12-31-39-0e-34-e1.compute-1.internal");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "RESOURCEMANAGER");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    // request with an empty set should get all supported properties
-    Request request = PropertyHelper.getReadRequest(Collections.<String>emptySet());
-
-    Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
-
-    Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-0e-34-e1.compute-1.internal", "8088"), streamProvider.getLastSpec());
-
-    // see test/resources/resourcemanager_jmx.json for values
-    Assert.assertEquals(6,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AggregateContainersAllocated")));
-    Assert.assertEquals(6,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AggregateContainersReleased")));
-    Assert.assertEquals(8192,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableMB")));
-    Assert.assertEquals(1,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableVCores")));
-    Assert.assertEquals(2,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AppsSubmitted")));
-    
-    Assert.assertEquals(1,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/ClusterMetrics", "NumActiveNMs")));
-    Assert.assertEquals(0,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/ClusterMetrics", "NumDecommissionedNMs")));
-    Assert.assertEquals(0,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/ClusterMetrics", "NumLostNMs")));
-    Assert.assertEquals(0,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/ClusterMetrics", "NumUnhealthyNMs")));
-    Assert.assertEquals(0,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/ClusterMetrics", "NumRebootedNMs")));
-
-    Assert.assertEquals(932118528,  resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "HeapMemoryMax")));
-
-    //namenode
-    resource = new ResourceImpl(Resource.Type.HostComponent);
-
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "domu-12-31-39-0e-34-e1.compute-1.internal");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "NAMENODE");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    // request with an empty set should get all supported properties
-    request = PropertyHelper.getReadRequest(Collections.<String>emptySet());
-
-    Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
-
-    Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-0e-34-e1" +
-      ".compute-1.internal", "50070"), streamProvider.getLastSpec());
-    Assert.assertEquals("active", resource.getPropertyValue(PropertyHelper
-      .getPropertyId("metrics/dfs/FSNamesystem", "HAState")));
-  }
-  
-  @Test
-  public void testPopulateResources_HDP2_params() throws Exception {
-    TestStreamProvider  streamProvider = new TestStreamProvider();
-    TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
-
-    JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        streamProvider,
-        hostProvider,
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
-
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "h1");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "RESOURCEMANAGER");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    // request with an empty set should get all supported properties
-    Request request = PropertyHelper.getReadRequest(Collections.<String>emptySet());
-
-    Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
-
-    Assert.assertEquals(propertyProvider.getSpec("h1", "8088"), streamProvider.getLastSpec());
-
-    // see test/resources/resourcemanager_jmx.json for values
-    Assert.assertEquals(6,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AggregateContainersAllocated")));
-    Assert.assertEquals(6,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AggregateContainersReleased")));
-    Assert.assertEquals(8192, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableMB")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableVCores")));
-    Assert.assertEquals(2,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AppsSubmitted")));
-    
-    Assert.assertEquals(15,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AggregateContainersAllocated")));
-    Assert.assertEquals(12,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AggregateContainersReleased")));
-    Assert.assertEquals(8192, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AvailableMB")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AvailableVCores")));
-    Assert.assertEquals(47,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AppsSubmitted")));
-    
-    Assert.assertEquals(4,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AggregateContainersAllocated")));
-    Assert.assertEquals(4,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AggregateContainersReleased")));
-    Assert.assertEquals(6048, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AvailableMB")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AvailableVCores")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AppsSubmitted")));
-  }
-
-  @Test
-  public void testPopulateResources_HDP2_params_singleProperty() throws Exception {
-    TestStreamProvider  streamProvider = new TestStreamProvider();
-    TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
-
-    JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        streamProvider,
-        hostProvider,
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
-
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "h1");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "RESOURCEMANAGER");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    // only ask for one property
-    Map<String, TemporalInfo> temporalInfoMap = new HashMap<String, TemporalInfo>();
-    Request  request = PropertyHelper.getReadRequest(Collections.singleton("metrics/yarn/Queue/root/AvailableMB"), temporalInfoMap);
-
-    Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
-
-    Assert.assertEquals(propertyProvider.getSpec("h1", "8088"), streamProvider.getLastSpec());
-
-    // see test/resources/resourcemanager_jmx.json for values
-    Assert.assertEquals(8192, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableMB")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableVCores")));
-  }
-
-  @Test
-  public void testPopulateResources_HDP2_params_category() throws Exception {
-    TestStreamProvider  streamProvider = new TestStreamProvider();
-    TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
-
-    JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        streamProvider,
-        hostProvider,
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
 
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "h1");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "RESOURCEMANAGER");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    // only ask for one property
-    Map<String, TemporalInfo> temporalInfoMap = new HashMap<String, TemporalInfo>();
-    Request  request = PropertyHelper.getReadRequest(Collections.singleton("metrics/yarn/Queue"), temporalInfoMap);
 
-    Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
-
-    Assert.assertEquals(propertyProvider.getSpec("h1", "8088"), streamProvider.getLastSpec());
-
-    // see test/resources/resourcemanager_jmx.json for values
-    Assert.assertEquals(6,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AggregateContainersAllocated")));
-    Assert.assertEquals(6,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AggregateContainersReleased")));
-    Assert.assertEquals(8192, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableMB")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableVCores")));
-    Assert.assertEquals(2,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AppsSubmitted")));
-
-    Assert.assertEquals(15,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AggregateContainersAllocated")));
-    Assert.assertEquals(12,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AggregateContainersReleased")));
-    Assert.assertEquals(8192, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AvailableMB")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AvailableVCores")));
-    Assert.assertEquals(47,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AppsSubmitted")));
-
-    Assert.assertEquals(4,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AggregateContainersAllocated")));
-    Assert.assertEquals(4,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AggregateContainersReleased")));
-    Assert.assertEquals(6048, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AvailableMB")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AvailableVCores")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AppsSubmitted")));
-  }
-
-  @Test
-  public void testPopulateResources_HDP2_params_category2() throws Exception {
-    TestStreamProvider  streamProvider = new TestStreamProvider();
-    TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
-
-    JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        streamProvider,
-        hostProvider,
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
-
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "h1");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "RESOURCEMANAGER");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    // only ask for one property
-    Map<String, TemporalInfo> temporalInfoMap = new HashMap<String, TemporalInfo>();
-    Request  request = PropertyHelper.getReadRequest(Collections.singleton("metrics/yarn/Queue/root/default"), temporalInfoMap);
-
-    Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
-
-    Assert.assertEquals(propertyProvider.getSpec("h1", "8088"), streamProvider.getLastSpec());
-
-    // see test/resources/resourcemanager_jmx.json for values
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AggregateContainersAllocated")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AggregateContainersReleased")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableMB")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AvailableVCores")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root", "AppsSubmitted")));
-
-    Assert.assertEquals(15,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AggregateContainersAllocated")));
-    Assert.assertEquals(12,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AggregateContainersReleased")));
-    Assert.assertEquals(8192, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AvailableMB")));
-    Assert.assertEquals(1,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AvailableVCores")));
-    Assert.assertEquals(47,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default", "AppsSubmitted")));
-
-    Assert.assertEquals(99,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default/sub_queue", "AggregateContainersAllocated")));
-    Assert.assertEquals(98,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default/sub_queue", "AggregateContainersReleased")));
-    Assert.assertEquals(9898, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default/sub_queue", "AvailableMB")));
-    Assert.assertEquals(2,    resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default/sub_queue", "AvailableVCores")));
-    Assert.assertEquals(97,   resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/default/sub_queue", "AppsSubmitted")));
-
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AggregateContainersAllocated")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AggregateContainersReleased")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AvailableMB")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AvailableVCores")));
-    Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/yarn/Queue/root/second_queue", "AppsSubmitted")));
-  }
 
   @Test
   public void testPopulateResourcesUnhealthyResource() throws Exception {
@@ -593,7 +348,7 @@ public class JMXPropertyProviderTest {
     TestJMXHostProvider hostProvider = new TestJMXHostProvider(true);
 
     JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent),
         streamProvider,
         hostProvider,
         PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
@@ -626,7 +381,7 @@ public class JMXPropertyProviderTest {
     Set<Resource> resources = new HashSet<Resource>();
 
     JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1),
+        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent),
         streamProvider,
         hostProvider,
         PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
@@ -663,190 +418,6 @@ public class JMXPropertyProviderTest {
     }
   }
 
-  @Test
-  public void testPopulateResources_JournalNode() throws Exception {
-    TestStreamProvider streamProvider = new TestStreamProvider();
-    TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
-
-    JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        streamProvider,
-        hostProvider,
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    // journalnode
-    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
-
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "domu-12-31-39-0e-34-e1.compute-1.internal");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "JOURNALNODE");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    // request with an empty set should get all supported properties
-    Request request = PropertyHelper.getReadRequest(Collections.<String>emptySet());
-
-    Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
-
-    Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-0e-34-e1.compute-1.internal", "8480"), streamProvider.getLastSpec());
-
-    // see test/resources/hdfs_journalnode_jmx.json for values
-    Assert.assertEquals(1377795104272L, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "startTime")));
-    Assert.assertEquals(954466304, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "HeapMemoryMax")));
-    Assert.assertEquals(14569736, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "HeapMemoryUsed")));
-    Assert.assertEquals(136314880, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "NonHeapMemoryMax")));
-    Assert.assertEquals(24993392, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "NonHeapMemoryUsed")));
-    Assert.assertEquals(9100, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "gcCount")));
-    Assert.assertEquals(31641, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "gcTimeMillis")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "logError")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "logFatal")));
-    Assert.assertEquals(4163, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "logInfo")));
-    Assert.assertEquals(1, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "logWarn")));
-    Assert.assertEquals(29.8125, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "memHeapCommittedM")));
-    Assert.assertEquals(13.894783, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "memHeapUsedM")));
-    Assert.assertEquals(24.9375, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "memNonHeapCommittedM")));
-    Assert.assertEquals(23.835556, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "memNonHeapUsedM")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "threadsBlocked")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "threadsNew")));
-    Assert.assertEquals(6, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "threadsRunnable")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "threadsTerminated")));
-    Assert.assertEquals(3, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "threadsTimedWaiting")));
-    Assert.assertEquals(8, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm", "threadsWaiting")));
-
-    Assert.assertEquals(1, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "NumOpenConnections")));
-    Assert.assertEquals(4928861, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "ReceivedBytes")));
-    Assert.assertEquals(13.211112159230245, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "RpcProcessingTime_avg_time")));
-    Assert.assertEquals(25067, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "RpcProcessingTime_num_ops")));
-    Assert.assertEquals(0.19686821997924706, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "RpcQueueTime_avg_time")));
-    Assert.assertEquals(25067, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "RpcQueueTime_num_ops")));
-    Assert.assertEquals(6578899, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "SentBytes")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "callQueueLen")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "rpcAuthenticationFailures")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "rpcAuthenticationSuccesses")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "rpcAuthorizationFailures")));
-    Assert.assertEquals(12459, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc", "rpcAuthorizationSuccesses")));
-
-    Assert.assertEquals(2, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "getJournalState_num_ops")));
-    Assert.assertEquals(0.0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "getJournalState_avg_time")));
-    Assert.assertEquals(2, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "newEpoch_num_ops")));
-    Assert.assertEquals(60.0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "newEpoch_avg_time")));
-    Assert.assertEquals(4129, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "startLogSegment_num_ops")));
-    Assert.assertEquals(38.25951359084413, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "startLogSegment_avg_time")));
-    Assert.assertEquals(8265, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "journal_num_ops")));
-    Assert.assertEquals(2.1832618025751187, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "journal_avg_time")));
-    Assert.assertEquals(4129, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "finalizeLogSegment_num_ops")));
-    Assert.assertEquals(11.575679542203101, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "finalizeLogSegment_avg_time")));
-    Assert.assertEquals(8536, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "getEditLogManifest_num_ops")));
-    Assert.assertEquals(12.55427859318747, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "getEditLogManifest_avg_time")));
-    Assert.assertEquals(1, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "prepareRecovery_num_ops")));
-    Assert.assertEquals(10.0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "prepareRecovery_avg_time")));
-    Assert.assertEquals(1, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "acceptRecovery_num_ops")));
-    Assert.assertEquals(30.0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpcdetailed", "acceptRecovery_avg_time")));
-
-    Assert.assertEquals(0.0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/ugi", "loginFailure_avg_time")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/ugi", "loginFailure_num_ops")));
-    Assert.assertEquals(0.0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/ugi", "loginSuccess_avg_time")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/ugi", "loginSuccess_num_ops")));
-
-    Assert.assertEquals("{\"mycluster\":{\"Formatted\":\"true\"}}", resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode", "journalsStatus")));
-
-    Assert.assertEquals(2, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs60s_num_ops")));
-    Assert.assertEquals(988, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs60s50thPercentileLatencyMicros")));
-    Assert.assertEquals(988, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs60s75thPercentileLatencyMicros")));
-    Assert.assertEquals(988, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs60s90thPercentileLatencyMicros")));
-    Assert.assertEquals(988, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs60s95thPercentileLatencyMicros")));
-    Assert.assertEquals(988, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs60s99thPercentileLatencyMicros")));
-    Assert.assertEquals(4, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs300s_num_ops")));
-    Assert.assertEquals(1027, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs300s50thPercentileLatencyMicros")));
-    Assert.assertEquals(1037, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs300s75thPercentileLatencyMicros")));
-    Assert.assertEquals(1037, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs300s90thPercentileLatencyMicros")));
-    Assert.assertEquals(1037, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs300s95thPercentileLatencyMicros")));
-    Assert.assertEquals(1037, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs300s99thPercentileLatencyMicros")));
-    Assert.assertEquals(60, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs3600s_num_ops")));
-    Assert.assertEquals(1122, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs3600s50thPercentileLatencyMicros")));
-    Assert.assertEquals(1344, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs3600s75thPercentileLatencyMicros")));
-    Assert.assertEquals(1554, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs3600s90thPercentileLatencyMicros")));
-    Assert.assertEquals(1980, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs3600s95thPercentileLatencyMicros")));
-    Assert.assertEquals(8442, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "syncs3600s99thPercentileLatencyMicros")));
-    Assert.assertEquals(8265, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "batchesWritten")));
-    Assert.assertEquals(8265, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "txnsWritten")));
-    Assert.assertEquals(107837, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "bytesWritten")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "batchesWrittenWhileLagging")));
-    Assert.assertEquals(2, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "lastPromisedEpoch")));
-    Assert.assertEquals(2, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "lastWriterEpoch")));
-    Assert.assertEquals(0, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "currentLagTxns")));
-    Assert.assertEquals(8444, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/dfs/journalnode/cluster/mycluster", "lastWrittenTxId")));
-  }
-  
-  @Test
-  public void testPopulateResources_NoRegionServer() throws Exception {
-    TestStreamProvider streamProvider = new TestStreamProvider();
-    TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
-
-    JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        streamProvider,
-        hostProvider,
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        null, // force use of the hostProvider, which returns null for this test
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
-
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "domu-12-31-39-0e-34-e1.compute-1.internal");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "HBASE_REGIONSERVER");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    int preSize = resource.getPropertiesMap().size();
-    
-    // request with an empty set should get all supported properties
-    Request request = PropertyHelper.getReadRequest(Collections.<String>emptySet());
-
-    Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
-
-    Assert.assertEquals(preSize, resource.getPropertiesMap().size());
-  }
-  
-  @Test
-  public void testPopulateResources_HBaseMaster2() throws Exception {
-    TestStreamProvider streamProvider = new TestStreamProvider();
-    TestJMXHostProvider hostProvider = new TestJMXHostProvider(false);
-
-    JMXPropertyProvider propertyProvider = new JMXPropertyProvider(
-        PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2),
-        streamProvider,
-        hostProvider,
-        PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-        PropertyHelper.getPropertyId("HostRoles", "host_name"),
-        PropertyHelper.getPropertyId("HostRoles", "component_name"),
-        PropertyHelper.getPropertyId("HostRoles", "state"),
-        Collections.singleton("STARTED"));
-
-    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
-
-    resource.setProperty("HostRoles/cluster_name", "HBM2");
-    resource.setProperty(HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "domu-12-31-39-0e-34-e1.compute-1.internal");
-    resource.setProperty(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "HBASE_MASTER");
-    resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, "STARTED");
-
-    
-    // request with an empty set should get all supported properties
-    Request request = PropertyHelper.getReadRequest(Collections.<String>emptySet());
-
-    Set<Resource> res = propertyProvider.populateResources(Collections.singleton(resource), request, null);
-    Assert.assertEquals(1, res.size());
-    
-    Map<String, Map<String, Object>> map = res.iterator().next().getPropertiesMap();
-
-    Assert.assertTrue(map.containsKey("metrics/hbase/master"));
-    // uses 'tag.isActiveMaster' (name with a dot)
-    Assert.assertTrue(map.get("metrics/hbase/master").containsKey("IsActiveMaster"));
-  }  
-    
   public static class TestJMXHostProvider implements JMXHostProvider {
     private final boolean unknownPort;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb80c2b7/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/PropertyHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/PropertyHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/PropertyHelperTest.java
index a22c96d..6380d4e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/PropertyHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/PropertyHelperTest.java
@@ -25,8 +25,6 @@ import org.junit.Test;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
@@ -56,7 +54,7 @@ public class PropertyHelperTest {
   public void testGetJMXPropertyIds() {
 
     //version 1
-    Map<String, Map<String, PropertyInfo>> metrics = PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP1);
+    Map<String, Map<String, PropertyInfo>> metrics = PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent);
     Map<String, PropertyInfo> componentMetrics = metrics.get("HISTORYSERVER");
     Assert.assertNull(componentMetrics);
     componentMetrics = metrics.get("NAMENODE");
@@ -65,15 +63,6 @@ public class PropertyHelperTest {
     Assert.assertNotNull(info);
     Assert.assertEquals("Hadoop:service=NameNode,name=jvm.memHeapUsedM", info.getPropertyId());
 
-    //version 2
-    metrics = PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent, PropertyHelper.MetricsVersion.HDP2);
-    componentMetrics = metrics.get("HISTORYSERVER");
-    Assert.assertNotNull(componentMetrics);
-    componentMetrics = metrics.get("NAMENODE");
-    Assert.assertNotNull(componentMetrics);
-    info = componentMetrics.get("metrics/jvm/memHeapUsedM");
-    Assert.assertNotNull(info);
-    Assert.assertEquals("Hadoop:service=NameNode,name=JvmMetrics.MemHeapUsedM", info.getPropertyId());
   }
 
   @Test
@@ -155,61 +144,55 @@ public class PropertyHelperTest {
    * this test.
    */
   public void testDuplicatePointInTimeMetrics() {
-    for (PropertyHelper.MetricsVersion version : PropertyHelper.MetricsVersion.values()) {
-
-      TreeSet<String> set = new TreeSet<String>();
+    TreeSet<String> set = new TreeSet<String>();
 
-      for (Resource.Type type : Resource.Type.values()) {
+    for (Resource.Type type : Resource.Type.values()) {
 
-        Map<String, Map<String, PropertyInfo>> gids =
-            PropertyHelper.getGangliaPropertyIds(type, version);
+      Map<String, Map<String, PropertyInfo>> gids = PropertyHelper.getGangliaPropertyIds(type);
 
-        Map<String, Map<String, PropertyInfo>> jids =
-            PropertyHelper.getJMXPropertyIds(type, version);
+      Map<String, Map<String, PropertyInfo>> jids = PropertyHelper.getJMXPropertyIds(type);
 
-        if (gids != null && jids != null) {
+      if (gids != null && jids != null) {
 
-          gids = normalizeMetricNames(gids);
-          jids = normalizeMetricNames(jids);
+        gids = normalizeMetricNames(gids);
+        jids = normalizeMetricNames(jids);
 
-          for (Map.Entry<String, Map<String, PropertyInfo>> gComponentEntry : gids.entrySet()) {
+        for (Map.Entry<String, Map<String, PropertyInfo>> gComponentEntry : gids.entrySet()) {
 
-            String gComponent = gComponentEntry.getKey();
+          String gComponent = gComponentEntry.getKey();
 
-            Set<Map.Entry<String, PropertyInfo>> gComponentEntries = gComponentEntry.getValue().entrySet();
+          Set<Map.Entry<String, PropertyInfo>> gComponentEntries = gComponentEntry.getValue().entrySet();
 
-            for (Map.Entry<String, PropertyInfo> gMetricEntry : gComponentEntries) {
+          for (Map.Entry<String, PropertyInfo> gMetricEntry : gComponentEntries) {
 
-              Map<String, PropertyInfo> jMetrics = jids.get(gComponent);
+            Map<String, PropertyInfo> jMetrics = jids.get(gComponent);
 
-              if (jMetrics != null) {
-                String gMetric = gMetricEntry.getKey();
-                PropertyInfo jProperty = jMetrics.get(gMetric);
+            if (jMetrics != null) {
+              String gMetric = gMetricEntry.getKey();
+              PropertyInfo jProperty = jMetrics.get(gMetric);
 
-                if (jProperty != null) {
-                  PropertyInfo gProperty = gMetricEntry.getValue();
-                  if (gProperty.isPointInTime()) {
-                    String s = type + " : " + gComponent + " : " + gMetric + " : " + gProperty.getPropertyId();
-                    set.add(s);
-                  }
+              if (jProperty != null) {
+                PropertyInfo gProperty = gMetricEntry.getValue();
+                if (gProperty.isPointInTime()) {
+                  String s = type + " : " + gComponent + " : " + gMetric + " : " + gProperty.getPropertyId();
+                  set.add(s);
                 }
               }
             }
           }
         }
       }
-      if (set.size() > 0) {
-        System.out.println("The following point in time metrics are defined for both JMX and Ganglia.");
-        System.out.println("The preference is to get point in time metrics from JMX only if possible.");
-        System.out.println("If the metric can be obtained from JMX then set \"pointInTime\" : false for ");
-        System.out.println("the metric in the Ganglia properties definition, otherwise remove the metric ");
-        System.out.println("from the JMX properties definition.\n");
-        System.out.println("Metric version :" + version + "\n");
-        for (String s : set) {
-          System.out.println(s);
-        }
-        Assert.fail("Found duplicate point in time metrics.");
+    }
+    if (set.size() > 0) {
+      System.out.println("The following point in time metrics are defined for both JMX and Ganglia.");
+      System.out.println("The preference is to get point in time metrics from JMX only if possible.");
+      System.out.println("If the metric can be obtained from JMX then set \"pointInTime\" : false for ");
+      System.out.println("the metric in the Ganglia properties definition, otherwise remove the metric ");
+      System.out.println("from the JMX properties definition.\n");
+      for (String s : set) {
+        System.out.println(s);
       }
+      Assert.fail("Found duplicate point in time metrics.");
     }
   }
 
@@ -223,68 +206,61 @@ public class PropertyHelperTest {
    * exception to this test.
    */
   public void testTemporalOnlyMetrics() {
+    TreeSet<String> set = new TreeSet<String>();
 
-    for (PropertyHelper.MetricsVersion version : PropertyHelper.MetricsVersion.values()) {
+    for (Resource.Type type : Resource.Type.values()) {
 
-      TreeSet<String> set = new TreeSet<String>();
+      Map<String, Map<String, PropertyInfo>> gids = PropertyHelper.getGangliaPropertyIds(type);
 
-      for (Resource.Type type : Resource.Type.values()) {
+      Map<String, Map<String, PropertyInfo>> jids = PropertyHelper.getJMXPropertyIds(type);
 
-        Map<String, Map<String, PropertyInfo>> gids =
-            PropertyHelper.getGangliaPropertyIds(type, version);
+      if (gids != null && jids != null) {
 
-        Map<String, Map<String, PropertyInfo>> jids =
-            PropertyHelper.getJMXPropertyIds(type, version);
+        gids = normalizeMetricNames(gids);
+        jids = normalizeMetricNames(jids);
 
-        if (gids != null && jids != null) {
+        for (Map.Entry<String, Map<String, PropertyInfo>> gComponentEntry : gids.entrySet()) {
 
-          gids = normalizeMetricNames(gids);
-          jids = normalizeMetricNames(jids);
+          String gComponent = gComponentEntry.getKey();
 
-          for (Map.Entry<String, Map<String, PropertyInfo>> gComponentEntry : gids.entrySet()) {
+          Set<Map.Entry<String, PropertyInfo>> gComponentEntries = gComponentEntry.getValue().entrySet();
 
-            String gComponent = gComponentEntry.getKey();
+          for (Map.Entry<String, PropertyInfo> gMetricEntry : gComponentEntries) {
 
-            Set<Map.Entry<String, PropertyInfo>> gComponentEntries = gComponentEntry.getValue().entrySet();
+            Map<String, PropertyInfo> jMetrics = jids.get(gComponent);
 
-            for (Map.Entry<String, PropertyInfo> gMetricEntry : gComponentEntries) {
+            if (jMetrics != null) {
 
-              Map<String, PropertyInfo> jMetrics = jids.get(gComponent);
+              String gMetric = gMetricEntry.getKey();
+              PropertyInfo gProperty = gMetricEntry.getValue();
 
-              if (jMetrics != null) {
-
-                String gMetric = gMetricEntry.getKey();
-                PropertyInfo gProperty = gMetricEntry.getValue();
+              if (!gProperty.isPointInTime()) {
 
-                if (!gProperty.isPointInTime()) {
-
-                  PropertyInfo jProperty = jMetrics.get(gMetric);
+                PropertyInfo jProperty = jMetrics.get(gMetric);
 
-                  if (jProperty == null || !jProperty.isPointInTime()) {
+                if (jProperty == null || !jProperty.isPointInTime()) {
 
-                    String s = type + " : " + gComponent + " : " + gMetric + " : " + gProperty.getPropertyId();
+                  String s = type + " : " + gComponent + " : " + gMetric + " : " + gProperty.getPropertyId();
 
-                    set.add(s);
-                  }
+                  set.add(s);
                 }
               }
             }
           }
         }
       }
-      if (set.size() > 0) {
-        System.out.println("The following metrics are marked as temporal only for Ganglia ");
-        System.out.println("but are not defined for JMX.");
-        System.out.println("The preference is to get point in time metrics from JMX if possible.");
-        System.out.println("If the metric can be obtained from JMX then add it to the JMX properties");
-        System.out.println("definition, otherwise set set \"pointInTime\" : true for the metric in ");
-        System.out.println("the Ganglia properties definition.\n");
-        System.out.println("Metric version :" + version + "\n");
-        for (String s : set) {
-          System.out.println(s);
-        }
-        Assert.fail("Found temporal only metrics.");
+    }
+    if (set.size() > 0) {
+      System.out.println("The following metrics are marked as temporal only for Ganglia ");
+      System.out.println("but are not defined for JMX.");
+      System.out.println("The preference is to get point in time metrics from JMX if possible.");
+      System.out.println("If the metric can be obtained from JMX then add it to the JMX properties");
+      System.out.println("definition, otherwise set set \"pointInTime\" : true for the metric in ");
+      System.out.println("the Ganglia properties definition.\n");
+      for (String s : set) {
+        System.out.println(s);
       }
+      Assert.fail("Found temporal only metrics.");
     }
   }
 
@@ -293,104 +269,46 @@ public class PropertyHelperTest {
    * Test to make sure that no JMX metrics are marked as point in time.
    */
   public void testJMXTemporal() {
+    TreeSet<String> set = new TreeSet<String>();
 
-    for (PropertyHelper.MetricsVersion version : PropertyHelper.MetricsVersion.values()) {
-
-      TreeSet<String> set = new TreeSet<String>();
-
-      for (Resource.Type type : Resource.Type.values()) {
-
-        Map<String, Map<String, PropertyInfo>> jids =
-            PropertyHelper.getJMXPropertyIds(type, version);
-
-        if (jids != null) {
-
-          for (Map.Entry<String, Map<String, PropertyInfo>> jComponentEntry : jids.entrySet()) {
-
-            String jComponent = jComponentEntry.getKey();
+    for (Resource.Type type : Resource.Type.values()) {
 
-            Set<Map.Entry<String, PropertyInfo>> jComponentEntries = jComponentEntry.getValue().entrySet();
-            for (Map.Entry<String, PropertyInfo> jMetricEntry : jComponentEntries) {
+      Map<String, Map<String, PropertyInfo>> jids = PropertyHelper.getJMXPropertyIds(type);
 
-              String jMetric = jMetricEntry.getKey();
+      if (jids != null) {
 
-              PropertyInfo jProperty = jMetricEntry.getValue();
+        for (Map.Entry<String, Map<String, PropertyInfo>> jComponentEntry : jids.entrySet()) {
 
-              if (jProperty.isTemporal()) {
-                String s = type + " : " + jComponent + " : " + jMetric + " : " + jProperty.getPropertyId();
+          String jComponent = jComponentEntry.getKey();
 
-                set.add(s);
-              }
-            }
-          }
-        }
-      }
+          Set<Map.Entry<String, PropertyInfo>> jComponentEntries = jComponentEntry.getValue().entrySet();
+          for (Map.Entry<String, PropertyInfo> jMetricEntry : jComponentEntries) {
 
-      if (set.size() > 0) {
-        System.out.println("The following metrics are marked as temporal JMX.");
-        System.out.println("JMX can provide point in time metrics only.\n");
-        System.out.println("Metric version :" + version + "\n");
-        for (String s : set) {
-          System.out.println(s);
-        }
-        Assert.fail("Found temporal JMX metrics.");
-      }
-    }
-  }
+            String jMetric = jMetricEntry.getKey();
 
-  @Test
-  /**
-   * Test to look for changes in case of the metric names
-   * (e.g. metrics/rpc/RpcQueueTime_num_ops to metrics/rpc/rpcQueueTime_num_ops).
-   */
-  public void testMetricCaseChange() {
-    Map<String, Set<String>> metricSet = new HashMap<String, Set<String>>();
-    for (int i = 0; i < 2; ++i) {
-      for (PropertyHelper.MetricsVersion version : PropertyHelper.MetricsVersion.values()) {
-        for (Resource.Type type : Resource.Type.values()) {
-
-          Map<String, Map<String, PropertyInfo>> ids = i == 0 ?
-              PropertyHelper.getGangliaPropertyIds(type, version) :
-              PropertyHelper.getJMXPropertyIds(type, version);
-
-          if (ids != null) {
+            PropertyInfo jProperty = jMetricEntry.getValue();
 
-            for (Map.Entry<String, Map<String, PropertyInfo>> gComponentEntry : ids.entrySet()) {
-              Set<Map.Entry<String, PropertyInfo>> gComponentEntries = gComponentEntry.getValue().entrySet();
-              for (Map.Entry<String, PropertyInfo> gMetricEntry : gComponentEntries) {
+            if (jProperty.isTemporal()) {
+              String s = type + " : " + jComponent + " : " + jMetric + " : " + jProperty.getPropertyId();
 
-                String gMetric = gMetricEntry.getKey();
-                String key = gMetric.toLowerCase();
-
-                Set<String> metrics = metricSet.get(key);
-                if (metrics == null) {
-                  metrics = new HashSet<String>();
-                  metricSet.put(key, metrics);
-                }
-                metrics.add(gMetric);
-              }
+              set.add(s);
             }
           }
         }
       }
     }
 
-    List<Set<String>> failureList = new LinkedList<Set<String>>();
-    for (Set<String> metrics : metricSet.values()) {
-      if (metrics.size() > 1) {
-        failureList.add(metrics);
+    if (set.size() > 0) {
+      System.out.println("The following metrics are marked as temporal JMX.");
+      System.out.println("JMX can provide point in time metrics only.\n");
+      for (String s : set) {
+        System.out.println(s);
       }
-    }
-
-    if (failureList.size() > 1) {
-      System.out.println("The following metrics differ only by case.\n");
-      for (Set<String> metrics : failureList) {
-        System.out.println("  " + metrics);
-      }
-      Assert.fail("Found metric name case differences.");
+      Assert.fail("Found temporal JMX metrics.");
     }
   }
 
+
   // remove any replacement tokens (e.g. $1.replaceAll(\",q(\\d+)=\",\"/\").substring(1)) in the metric names
   private static Map<String, Map<String, PropertyInfo>> normalizeMetricNames(Map<String, Map<String, PropertyInfo>> gids) {
 


Mime
View raw message