Author: stack Date: Wed Sep 2 22:19:42 2009 New Revision: 810714 URL: http://svn.apache.org/viewvc?rev=810714&view=rev Log: HADOOP-4675 Current Ganglia metrics implementation is incompatible with Ganglia 3.1 -- reversing this patch
Removed: hadoop/common/trunk/src/java/org/apache/hadoop/metrics/ganglia/GangliaContext31.java Modified: hadoop/common/trunk/CHANGES.txt hadoop/common/trunk/conf/hadoop-metrics.properties hadoop/common/trunk/src/java/org/apache/hadoop/metrics/ganglia/GangliaContext.java Modified: hadoop/common/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=810714&r1=810713&r2=810714&view=diff ============================================================================== --- hadoop/common/trunk/CHANGES.txt (original) +++ hadoop/common/trunk/CHANGES.txt Wed Sep 2 22:19:42 2009 @@ -515,9 +515,6 @@ HADOOP-6224. Add a method to WritableUtils performing a bounded read of an encoded String. (Jothi Padmanabhan via cdouglas) - HADOOP-4675 Current Ganglia metrics implementation is incompatible with Ganglia 3.1 - (Brian Brockelman, Scott Beardsley via stack) - OPTIMIZATIONS HADOOP-5595. NameNode does not need to run a replicator to choose a Modified: hadoop/common/trunk/conf/hadoop-metrics.properties URL: http://svn.apache.org/viewvc/hadoop/common/trunk/conf/hadoop-metrics.properties?rev=810714&r1=810713&r2=810714&view=diff ============================================================================== --- hadoop/common/trunk/conf/hadoop-metrics.properties (original) +++ hadoop/common/trunk/conf/hadoop-metrics.properties Wed Sep 2 22:19:42 2009 @@ -7,9 +7,7 @@ #dfs.fileName=/tmp/dfsmetrics.log # Configuration of the "dfs" context for ganglia -# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter) # dfs.class=org.apache.hadoop.metrics.ganglia.GangliaContext -# dfs.class=org.apache.hadoop.metrics.ganglia.GangliaContext31 # dfs.period=10 # dfs.servers=localhost:8649 @@ -23,15 +21,13 @@ #mapred.fileName=/tmp/mrmetrics.log # Configuration of the "mapred" context for ganglia -# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter) # mapred.class=org.apache.hadoop.metrics.ganglia.GangliaContext -# mapred.class=org.apache.hadoop.metrics.ganglia.GangliaContext31 # mapred.period=10 # mapred.servers=localhost:8649 # Configuration of the "jvm" context for null -#jvm.class=org.apache.hadoop.metrics.spi.NullContext +jvm.class=org.apache.hadoop.metrics.spi.NullContext # Configuration of the "jvm" context for file #jvm.class=org.apache.hadoop.metrics.file.FileContext Modified: hadoop/common/trunk/src/java/org/apache/hadoop/metrics/ganglia/GangliaContext.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/metrics/ganglia/GangliaContext.java?rev=810714&r1=810713&r2=810714&view=diff ============================================================================== --- hadoop/common/trunk/src/java/org/apache/hadoop/metrics/ganglia/GangliaContext.java (original) +++ hadoop/common/trunk/src/java/org/apache/hadoop/metrics/ganglia/GangliaContext.java Wed Sep 2 22:19:42 2009 @@ -71,16 +71,16 @@ typeTable.put(Float.class, "float"); } - protected byte[] buffer = new byte[BUFFER_SIZE]; - protected int offset; + private byte[] buffer = new byte[BUFFER_SIZE]; + private int offset; - protected List<? extends SocketAddress> metricsServers; + private List<? extends SocketAddress> metricsServers; private Map<String,String> unitsTable; private Map<String,String> slopeTable; private Map<String,String> tmaxTable; private Map<String,String> dmaxTable; - protected DatagramSocket datagramSocket; + private DatagramSocket datagramSocket; /** Creates a new instance of GangliaContext */ public GangliaContext() { @@ -132,7 +132,7 @@ } } - protected void emitMetric(String name, String type, String value) + private void emitMetric(String name, String type, String value) throws IOException { String units = getUnits(name); int slope = getSlope(name); @@ -156,7 +156,7 @@ } } - protected String getUnits(String metricName) { + private String getUnits(String metricName) { String result = unitsTable.get(metricName); if (result == null) { result = DEFAULT_UNITS; @@ -164,7 +164,7 @@ return result; } - protected int getSlope(String metricName) { + private int getSlope(String metricName) { String slopeString = slopeTable.get(metricName); if (slopeString == null) { slopeString = DEFAULT_SLOPE; @@ -172,7 +172,7 @@ return ("zero".equals(slopeString) ? 0 : 3); // see gmetric.c } - protected int getTmax(String metricName) { + private int getTmax(String metricName) { if (tmaxTable == null) { return DEFAULT_TMAX; } @@ -185,7 +185,7 @@ } } - protected int getDmax(String metricName) { + private int getDmax(String metricName) { String dmaxString = dmaxTable.get(metricName); if (dmaxString == null) { return DEFAULT_DMAX; @@ -200,7 +200,7 @@ * as an int, followed by the bytes of the string, padded if necessary to * a multiple of 4. */ - protected void xdr_string(String s) { + private void xdr_string(String s) { byte[] bytes = s.getBytes(); int len = bytes.length; xdr_int(len); @@ -222,7 +222,7 @@ /** * Puts an integer into the buffer as 4 bytes, big-endian. */ - protected void xdr_int(int i) { + private void xdr_int(int i) { buffer[offset++] = (byte)((i >> 24) & 0xff); buffer[offset++] = (byte)((i >> 16) & 0xff); buffer[offset++] = (byte)((i >> 8) & 0xff);