Author: mahadev
Date: Fri Jan 18 23:05:09 2013
New Revision: 1435409
URL: http://svn.apache.org/viewvc?rev=1435409&view=rev
Log:
AMBARI-1178. Fix use of use ip address for JMX metrics request. (tbeerbower via
mahadev)
Removed:
incubator/ambari/trunk/ambari-agent/.project
incubator/ambari/trunk/ambari-agent/.pydevproject
incubator/ambari/trunk/ambari-agent/ambari-agent.iml
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-mysql/files/startMysql.sh
incubator/ambari/trunk/ambari-project/ambari-project.iml
incubator/ambari/trunk/ambari-server/.classpath
incubator/ambari/trunk/ambari-server/.project
incubator/ambari/trunk/ambari-server/.pydevproject
incubator/ambari/trunk/ambari-server/.settings/org.eclipse.jdt.core.prefs
incubator/ambari/trunk/ambari-server/.settings/org.eclipse.jdt.ui.prefs
incubator/ambari/trunk/ambari-server/ambari-server.iml
incubator/ambari/trunk/ambari-server/derby.log
incubator/ambari/trunk/ambari-server/pass.txt
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/DelegatingRequestHandler.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/BasePersistenceManager.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/CreatePersistenceManager.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/DeletePersistenceManager.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/PersistenceManager.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/QueryCreateRequest.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestImpl.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/ResponseFactory.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/UpdatePersistenceManager.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/MetricsMapping.java
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/api/handlers/DelegatingRequestHandlerTest.java
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/api/services/CreatePersistenceManagerTest.java
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeletePersistenceManagerTest.java
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestImplTest.java
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/TestHostMappingProvider.java
incubator/ambari/trunk/ambari.iml
incubator/ambari/trunk/contrib/ambari-log4j/.classpath
incubator/ambari/trunk/contrib/ambari-log4j/.project
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-agent/pom.xml
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/service.pp
incubator/ambari/trunk/ambari-server/pom.xml
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/eventdb/db/PostgresConnector.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProvider.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXHostProvider.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
incubator/ambari/trunk/ambari-server/src/main/resources/stacks/HDP/1.2.0/services/MAPREDUCE/configuration/mapred-site.xml
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProviderTest.java
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/TestProviderModule.java
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
incubator/ambari/trunk/pom.xml
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Jan 18 23:05:09 2013
@@ -59,6 +59,9 @@ Trunk (unreleased changes):
AMBARI-1184. After adding hosts, the host count shown in the Dashboard is
incorrect. (yusaku)
+ AMBARI-1178. Fix use of use ip address for JMX metrics request. (tbeerbower
+ via mahadev)
+
AMBARI-1.2.0 branch:
INCOMPATIBLE CHANGES
Modified: incubator/ambari/trunk/ambari-agent/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/pom.xml?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/pom.xml (original)
+++ incubator/ambari/trunk/ambari-agent/pom.xml Fri Jan 18 23:05:09 2013
@@ -150,6 +150,10 @@
<scriptFile>src/main/package/rpm/preinstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</preinstallScriptlet>
+ <preremoveScriptlet>
+ <script>mv /etc/ambari-agent/conf
/etc/ambari-agent/conf.save</script>
+ </preremoveScriptlet>
+
<needarch>x86_64</needarch>
<autoRequires>false</autoRequires>
<mappings>
Modified:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/service.pp
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/service.pp?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/service.pp
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/service.pp
Fri Jan 18 23:05:09 2013
@@ -85,11 +85,10 @@ class hdp-zookeeper::service(
class hdp-zookeeper::set_myid($myid)
{
- $create_file = "${hdp-zookeeper::params::zk_data_dir}/myid"
- $cmd = "echo '${myid}' > ${create_file}"
- hdp::exec{ $cmd:
- command => $cmd,
- creates => $create_file
+ file {"${hdp-zookeeper::params::zk_data_dir}/myid":
+ ensure => file,
+ content => $myid,
+ mode => 0644,
}
}
Modified: incubator/ambari/trunk/ambari-server/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/pom.xml?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/pom.xml (original)
+++ incubator/ambari/trunk/ambari-server/pom.xml Fri Jan 18 23:05:09 2013
@@ -96,6 +96,9 @@
<require>openssl</require>
<require>${python.ver}</require>
</requires>
+ <preremoveScriptlet>
+ <script>mv /etc/ambari-server/conf
/etc/ambari-server/conf.save</script>
+ </preremoveScriptlet>
<mappings>
<mapping>
<directory>/usr/lib/ambari-server</directory>
Modified:
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/eventdb/db/PostgresConnector.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/eventdb/db/PostgresConnector.java?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/eventdb/db/PostgresConnector.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/eventdb/db/PostgresConnector.java
Fri Jan 18 23:05:09 2013
@@ -440,7 +440,7 @@ public class PostgresConnector implement
return field.toString() + " >= " + s;
}
- private static final String WHERE = " where";
+ private static final String WHERE = " where ";
private static String buildSearchClause(String searchTerm, String
searchWorkflowId, String searchWorkflowName, String searchWorkflowType,
String searchUserName, int minJobs, int maxJobs, long minInputBytes,
long maxInputBytes, long minOutputBytes, long maxOutputBytes, long minDuration,
@@ -448,7 +448,7 @@ public class PostgresConnector implement
StringBuilder sb = new StringBuilder();
sb.append(WHERE);
if (searchTerm != null && searchTerm.length() > 0) {
- sb.append(" (");
+ sb.append("(");
sb.append(like(WorkflowFields.WORKFLOWID, searchTerm));
sb.append(" or ");
sb.append(like(WorkflowFields.WORKFLOWNAME, searchTerm));
Modified:
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProvider.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProvider.java?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProvider.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProvider.java
Fri Jan 18 23:05:09 2013
@@ -434,8 +434,8 @@ public abstract class GangliaPropertyPro
}
}
} catch (IOException e) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Caught exception getting Ganglia metrics : spec=" + spec,
e);
+ if (LOG.isErrorEnabled()) {
+ LOG.error("Caught exception getting Ganglia metrics : spec=" + spec,
e);
}
}
return populatedResources;
Modified:
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
Fri Jan 18 23:05:09 2013
@@ -46,16 +46,11 @@ import java.util.Set;
*/
public abstract class AbstractProviderModule implements ProviderModule,
ResourceProviderObserver, JMXHostProvider, GangliaHostProvider {
- private static final String HOST_CLUSTER_NAME_PROPERTY_ID =
PropertyHelper.getPropertyId("Hosts", "cluster_name");
- private static final String HOST_NAME_PROPERTY_ID =
PropertyHelper.getPropertyId("Hosts", "host_name");
- private static final String HOST_IP_PROPERTY_ID =
PropertyHelper.getPropertyId("Hosts", "ip");
private static final String CLUSTER_NAME_PROPERTY_ID =
PropertyHelper.getPropertyId("Clusters", "cluster_name");
private static final String HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID =
PropertyHelper.getPropertyId("HostRoles", "cluster_name");
private static final String HOST_COMPONENT_HOST_NAME_PROPERTY_ID =
PropertyHelper.getPropertyId("HostRoles", "host_name");
private static final String HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID =
PropertyHelper.getPropertyId("HostRoles", "component_name");
private static final String GANGLIA_SERVER =
"GANGLIA_SERVER";
- private static final String GANGLIA_MONITOR =
"GANGLIA_MONITOR";
- private static final String GANGLIA_SERVER_OLD =
"GANGLIA_MONITOR_SERVER";
/**
* The map of resource providers.
@@ -71,10 +66,8 @@ public abstract class AbstractProviderMo
private AmbariManagementController managementController;
/**
- * The map of hosts.
+ * The map of host components.
*/
- private Map<String, Map<String, String>> clusterHostMap;
-
private Map<String, Map<String, String>> clusterHostComponentMap;
/**
@@ -142,12 +135,6 @@ public abstract class AbstractProviderMo
return clusterHostComponentMap.get(clusterName).get(componentName);
}
- @Override
- public Map<String, String> getHostMapping(String clusterName) throws
SystemException {
- checkInit();
- return clusterHostMap.get(clusterName);
- }
-
// ----- GangliaHostProvider -----------------------------------------------
@@ -268,7 +255,6 @@ public abstract class AbstractProviderMo
try {
Set<Resource> clusters = provider.getResources(request, null);
- clusterHostMap = new HashMap<String, Map<String, String>>();
clusterHostComponentMap = new HashMap<String, Map<String, String>>();
clusterGangliaCollectorMap = new HashMap<String, String>();
@@ -276,34 +262,13 @@ public abstract class AbstractProviderMo
String clusterName = (String)
cluster.getPropertyValue(CLUSTER_NAME_PROPERTY_ID);
- // initialize the host map from the known hosts...
- provider = getResourceProvider(Resource.Type.Host);
- request = PropertyHelper.getReadRequest(HOST_NAME_PROPERTY_ID,
HOST_IP_PROPERTY_ID);
-
- Predicate predicate = new
PredicateBuilder().property(HOST_CLUSTER_NAME_PROPERTY_ID).
- equals(clusterName).toPredicate();
-
- Set<Resource> hosts = provider.getResources(request,
predicate);
- Map<String, String> hostMap = clusterHostMap.get(clusterName);
-
- if (hostMap == null) {
- hostMap = new HashMap<String, String>();
- clusterHostMap.put(clusterName, hostMap);
- }
-
- for (Resource host : hosts) {
- String hostName = (String)
host.getPropertyValue(HOST_NAME_PROPERTY_ID);
- String hostIp = (String)
host.getPropertyValue(HOST_IP_PROPERTY_ID);
- hostMap.put(hostName, hostIp == null ? hostName : hostIp);
- }
-
// initialize the host component map and Ganglia server from the known
hosts components...
provider = getResourceProvider(Resource.Type.HostComponent);
request =
PropertyHelper.getReadRequest(HOST_COMPONENT_HOST_NAME_PROPERTY_ID,
HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID);
- predicate = new
PredicateBuilder().property(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID).
+ Predicate predicate = new
PredicateBuilder().property(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID).
equals(clusterName).toPredicate();
Set<Resource> hostComponents = provider.getResources(request,
predicate);
@@ -318,11 +283,11 @@ public abstract class AbstractProviderMo
String componentName = (String)
hostComponent.getPropertyValue(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID);
String hostName = (String)
hostComponent.getPropertyValue(HOST_COMPONENT_HOST_NAME_PROPERTY_ID);
- hostComponentMap.put(componentName, hostMap.get(hostName));
+ hostComponentMap.put(componentName, hostName);
// record the Ganglia server for the current cluster
- if (componentName.equals(GANGLIA_SERVER) ||
componentName.equals(GANGLIA_MONITOR)
||componentName.equals(GANGLIA_SERVER_OLD)) {
- clusterGangliaCollectorMap.put(clusterName,
clusterHostMap.get(clusterName).get(hostName));
+ if (componentName.equals(GANGLIA_SERVER)) {
+ clusterGangliaCollectorMap.put(clusterName, hostName);
}
}
}
Modified:
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXHostProvider.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXHostProvider.java?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXHostProvider.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXHostProvider.java
Fri Jan 18 23:05:09 2013
@@ -37,16 +37,4 @@ public interface JMXHostProvider {
* @throws SystemException of unable to ge the JMX host name
*/
public String getHostName(String clusterName, String componentName) throws
SystemException;
-
-
- /**
- * Get the host name mappings for the given cluster name.
- *
- * @param clusterName the cluster name
- *
- * @return the host name mappings
- *
- * @throws SystemException if unable to get the host mappings
- */
- public Map<String, String> getHostMapping(String clusterName) throws
SystemException ;
}
Modified:
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
Fri Jan 18 23:05:09 2013
@@ -159,12 +159,6 @@ public class JMXPropertyProvider impleme
}
String clusterName = (String)
resource.getPropertyValue(clusterNamePropertyId);
-
- // TODO : what should we do if the host mapping is null?
- if (jmxHostProvider.getHostMapping(clusterName) == null) {
- return true;
- }
-
String componentName = (String)
resource.getPropertyValue(componentNamePropertyId);
String port = JMX_PORTS.get(componentName);
@@ -173,8 +167,7 @@ public class JMXPropertyProvider impleme
hostName = jmxHostProvider.getHostName(clusterName, componentName);
}
else {
- String name = (String) resource.getPropertyValue(hostNamePropertyId);
- hostName = jmxHostProvider.getHostMapping(clusterName).get(name);
+ hostName = (String) resource.getPropertyValue(hostNamePropertyId);
}
Map<String, PropertyInfo> metrics = componentMetrics.get(componentName);
@@ -247,8 +240,8 @@ public class JMXPropertyProvider impleme
}
}
} catch (IOException e) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Caught exception getting JMX metrics : spec=" + spec, e);
+ if (LOG.isErrorEnabled()) {
+ LOG.error("Caught exception getting JMX metrics : spec=" + spec, e);
}
}
Modified:
incubator/ambari/trunk/ambari-server/src/main/resources/stacks/HDP/1.2.0/services/MAPREDUCE/configuration/mapred-site.xml
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/resources/stacks/HDP/1.2.0/services/MAPREDUCE/configuration/mapred-site.xml?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/main/resources/stacks/HDP/1.2.0/services/MAPREDUCE/configuration/mapred-site.xml
(original)
+++
incubator/ambari/trunk/ambari-server/src/main/resources/stacks/HDP/1.2.0/services/MAPREDUCE/configuration/mapred-site.xml
Fri Jan 18 23:05:09 2013
@@ -72,7 +72,7 @@
<property>
<name>mapred.system.dir</name>
- <value>/mapred/system</value>
+ <value></value>
<description>No description</description>
<final>true</final>
</property>
Modified:
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProviderTest.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProviderTest.java?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProviderTest.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProviderTest.java
Fri Jan 18 23:05:09 2013
@@ -68,7 +68,7 @@ public class GangliaPropertyProviderTest
Assert.assertEquals(1,
propertyProvider.populateResources(Collections.singleton(resource), request,
null).size());
-
Assert.assertEquals("http://ec2-23-23-71-42.compute-1.amazonaws.com/cgi-bin/rrd.py?c=HDPSlaves&h=domU-12-31-39-0E-34-E1.compute-1.internal&m=jvm.metrics.gcCount&s=10&e=20&r=1",
+
Assert.assertEquals("http://domU-12-31-39-0E-34-E1.compute-1.internal/cgi-bin/rrd.py?c=HDPSlaves&h=domU-12-31-39-0E-34-E1.compute-1.internal&m=jvm.metrics.gcCount&s=10&e=20&r=1",
streamProvider.getLastSpec());
Assert.assertEquals(3, PropertyHelper.getProperties(resource).size());
@@ -110,7 +110,7 @@ public class GangliaPropertyProviderTest
Assert.assertEquals(3, propertyProvider.populateResources(resources,
request, null).size());
-
Assert.assertEquals("http://ec2-23-23-71-42.compute-1.amazonaws.com/cgi-bin/rrd.py?c=HDPSlaves&h=domU-12-31-39-0E-34-E3.compute-1.internal,domU-12-31-39-0E-34-E1.compute-1.internal,domU-12-31-39-0E-34-E2.compute-1.internal&m=jvm.metrics.gcCount&s=10&e=20&r=1",
+
Assert.assertEquals("http://domU-12-31-39-0E-34-E1.compute-1.internal/cgi-bin/rrd.py?c=HDPSlaves&h=domU-12-31-39-0E-34-E3.compute-1.internal,domU-12-31-39-0E-34-E1.compute-1.internal,domU-12-31-39-0E-34-E2.compute-1.internal&m=jvm.metrics.gcCount&s=10&e=20&r=1",
streamProvider.getLastSpec());
for (Resource res : resources) {
@@ -123,7 +123,7 @@ public class GangliaPropertyProviderTest
@Override
public String getGangliaCollectorHostName(String clusterName) {
- return "ec2-23-23-71-42.compute-1.amazonaws.com";
+ return "domU-12-31-39-0E-34-E1.compute-1.internal";
}
}
}
Modified:
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/TestProviderModule.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/TestProviderModule.java?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/TestProviderModule.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/TestProviderModule.java
Fri Jan 18 23:05:09 2013
@@ -19,7 +19,6 @@
package org.apache.ambari.server.controller.internal;
import org.apache.ambari.server.controller.jdbc.TestJDBCResourceProvider;
-import org.apache.ambari.server.controller.jmx.TestHostMappingProvider;
import org.apache.ambari.server.controller.spi.PropertyProvider;
import org.apache.ambari.server.controller.spi.ProviderModule;
import org.apache.ambari.server.controller.spi.Resource;
@@ -56,33 +55,9 @@ public class TestProviderModule implemen
List<PropertyProvider> providers = new LinkedList<PropertyProvider>();
-// PropertyProvider propertyProvider = new GangliaPropertyProvider(
-// PropertyHelper.getGangliaPropertyIds(Resource.Type.Component),
-// new org.apache.ambari.server.controller.ganglia.TestStreamProvider(),
-// "ec2-23-23-71-42.compute-1.amazonaws.com",
-// null, null,
-// PropertyHelper.getPropertyId("component_name",
"ServiceComponentInfo"));
-// providers.add(propertyProvider);
-
propertyProviders.put(Resource.Type.Component, providers);
providers = new LinkedList<PropertyProvider>();
- Map<String, String> hostMap = TestHostMappingProvider.getHostMap();
-
-// PropertyProvider propertyProvider = new JMXPropertyProvider(
-// PropertyHelper.getJMXPropertyIds(Resource.Type.HostComponent),
-// new org.apache.ambari.server.controller.jmx.TestStreamProvider(),
-// hostMap);
-// providers.add(propertyProvider);
-
-
-// propertyProvider = new GangliaPropertyProvider(
-// PropertyHelper.getGangliaPropertyIds(Resource.Type.HostComponent),
-// new org.apache.ambari.server.controller.ganglia.TestStreamProvider(),
-// "ec2-23-23-71-42.compute-1.amazonaws.com",
-// null, PropertyHelper.getPropertyId("host_name", "HostRoles"),
-// PropertyHelper.getPropertyId("component_name", "HostRoles"));
-// providers.add(propertyProvider);
propertyProviders.put(Resource.Type.HostComponent, providers);
}
Modified:
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
(original)
+++
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
Fri Jan 18 23:05:09 2013
@@ -26,7 +26,6 @@ import org.junit.Assert;
import org.junit.Test;
import java.util.Collections;
-import java.util.Map;
/**
* JMX property provider tests.
@@ -58,7 +57,7 @@ public class JMXPropertyProviderTest {
Assert.assertEquals(1,
propertyProvider.populateResources(Collections.singleton(resource), request,
null).size());
-
Assert.assertEquals(propertyProvider.getSpec("ec2-50-17-129-192.compute-1.amazonaws.com:50070"),
streamProvider.getLastSpec());
+
Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-0e-34-e1.compute-1.internal:50070"),
streamProvider.getLastSpec());
// see test/resources/hdfs_namenode_jmx.json for values
Assert.assertEquals(1084287,
resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc",
"ReceivedBytes")));
@@ -77,7 +76,7 @@ public class JMXPropertyProviderTest {
propertyProvider.populateResources(Collections.singleton(resource),
request, null);
-
Assert.assertEquals(propertyProvider.getSpec("ec2-23-23-71-42.compute-1.amazonaws.com:50075"),
streamProvider.getLastSpec());
+
Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-14-ee-b3.compute-1.internal:50075"),
streamProvider.getLastSpec());
// see test/resources/hdfs_datanode_jmx.json for values
Assert.assertEquals(0,
resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/rpc",
"ReceivedBytes")));
@@ -95,7 +94,7 @@ public class JMXPropertyProviderTest {
propertyProvider.populateResources(Collections.singleton(resource),
request, null);
-
Assert.assertEquals(propertyProvider.getSpec("ec2-23-23-71-42.compute-1.amazonaws.com:50030"),
streamProvider.getLastSpec());
+
Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-14-ee-b3.compute-1.internal:50030"),
streamProvider.getLastSpec());
// see test/resources/mapreduce_jobtracker_jmx.json for values
// resource should now contain 3 properties... host name, component name,
and jvm.threadsWaiting (from request)
@@ -104,17 +103,10 @@ public class JMXPropertyProviderTest {
Assert.assertNull(resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/jvm",
"gcCount")));
}
-
-
private static class TestJMXHostProvider implements JMXHostProvider {
@Override
public String getHostName(String clusterName, String componentName) {
return null;
}
-
- @Override
- public Map<String, String> getHostMapping(String clusterName) {
- return TestHostMappingProvider.getHostMap();
- }
}
}
Modified: incubator/ambari/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/pom.xml?rev=1435409&r1=1435408&r2=1435409&view=diff
==============================================================================
--- incubator/ambari/trunk/pom.xml (original)
+++ incubator/ambari/trunk/pom.xml Fri Jan 18 23:05:09 2013
@@ -115,7 +115,6 @@
<excludes>
<exclude>**/*.json</exclude>
<exclude>derby.log</exclude>
- <exclude>CHANGES.txt</exclude>
<exclude>AMBARI-666-CHANGES.txt</exclude>
<exclude>pass.txt</exclude>
<exclude>contrib/addons/test/dataServices/jmx/data/cluster_configuration.json.nohbase</exclude>