You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by js...@apache.org on 2013/02/19 23:53:07 UTC
svn commit: r1447954 - in /incubator/ambari/trunk: ./
ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/
ambari-server/src/test/java/org/apache/ambari/server/controller/ganglia/
Author: jspeidel
Date: Tue Feb 19 22:53:07 2013
New Revision: 1447954
URL: http://svn.apache.org/r1447954
Log:
AMBARI-1446. Ganglia rrd url may exceed max length for large clusters
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProvider.java
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProviderTest.java
Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1447954&r1=1447953&r2=1447954&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Feb 19 22:53:07 2013
@@ -298,6 +298,9 @@ Trunk (unreleased changes):
AMBARI-1439. rrd file location should be configurable through UI. (jaimin)
+ AMBARI-1446. URL used by API to invoke Ganglia rrd script may exceed max length
+ for query string for large clusters. (jspeidel)
+
AMBARI-1431. Hosts table no longer allows sorting. (yusaku)
AMBARI-1376. Wrong calculation of duration filter on apps page. (jaimin via
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=1447954&r1=1447953&r2=1447954&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 Tue Feb 19 22:53:07 2013
@@ -250,7 +250,7 @@ public abstract class GangliaPropertyPro
TemporalInfo temporalInfo) throws SystemException {
String clusters = getSetString(clusterSet, -1);
- String hosts = getSetString(hostSet, -1);
+ String hosts = getSetString(hostSet, 100);
String metrics = getSetString(metricSet, 50);
StringBuilder sb = new StringBuilder();
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=1447954&r1=1447953&r2=1447954&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 Tue Feb 19 22:53:07 2013
@@ -149,7 +149,6 @@ public class GangliaPropertyProviderTest
Request request = PropertyHelper.getReadRequest(Collections.singleton(PROPERTY_ID), temporalInfoMap);
Assert.assertEquals(3, propertyProvider.populateResources(resources, request, null).size());
-
Assert.assertEquals("http://domU-12-31-39-0E-34-E1.compute-1.internal/cgi-bin/rrd.py?c=HDPJobTracker,HDPHBaseMaster,HDPSlaves,HDPNameNode&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());
@@ -159,6 +158,39 @@ public class GangliaPropertyProviderTest
}
}
+ @Test
+ public void testPopulateResources__LargeNumberOfHostResources() throws Exception {
+ TestStreamProvider streamProvider = new TestStreamProvider();
+ TestGangliaHostProvider hostProvider = new TestGangliaHostProvider();
+
+ GangliaPropertyProvider propertyProvider = new GangliaHostPropertyProvider(
+ PropertyHelper.getGangliaPropertyIds(Resource.Type.Host),
+ streamProvider,
+ hostProvider,
+ CLUSTER_NAME_PROPERTY_ID,
+ HOST_NAME_PROPERTY_ID
+ );
+
+ Set<Resource> resources = new HashSet<Resource>();
+
+ for (int i = 0; i < 150; ++i) {
+ Resource resource = new ResourceImpl(Resource.Type.Host);
+ resource.setProperty(HOST_NAME_PROPERTY_ID, "host" + i);
+ resources.add(resource);
+ }
+
+ // only ask for one property
+ Map<String, TemporalInfo> temporalInfoMap = new HashMap<String, TemporalInfo>();
+ temporalInfoMap.put(PROPERTY_ID, new TemporalInfoImpl(10L, 20L, 1L));
+ Request request = PropertyHelper.getReadRequest(Collections.singleton(PROPERTY_ID), temporalInfoMap);
+
+ Assert.assertEquals(150, propertyProvider.populateResources(resources, request, null).size());
+
+ Assert.assertEquals("http://domU-12-31-39-0E-34-E1.compute-1.internal/cgi-bin/rrd.py?c=HDPJobTracker,HDPHBaseMaster,HDPSlaves,HDPNameNode&m=jvm.metrics.gcCount&s=10&e=20&r=1",
+ streamProvider.getLastSpec());
+
+ }
+
private static class TestGangliaHostProvider implements GangliaHostProvider {
@Override