hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r732649 - in /hadoop/core/branches/branch-0.20: ./ src/contrib/chukwa/conf/ src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/connector/http/ src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/sender/
Date Thu, 08 Jan 2009 09:04:28 GMT
Author: cdouglas
Date: Thu Jan  8 01:04:28 2009
New Revision: 732649

URL: http://svn.apache.org/viewvc?rev=732649&view=rev
Log:
HADOOP-4925. Make Chukwa sender properties configurable. Contributed by Ari Rabkin.

Modified:
    hadoop/core/branches/branch-0.20/CHANGES.txt
    hadoop/core/branches/branch-0.20/src/contrib/chukwa/conf/chukwa-agent-conf.xml.template
    hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/connector/http/HttpConnector.java
    hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/sender/ChukwaHttpSender.java

Modified: hadoop/core/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/CHANGES.txt?rev=732649&r1=732648&r2=732649&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.20/CHANGES.txt Thu Jan  8 01:04:28 2009
@@ -523,6 +523,9 @@
     HADOOP-4916. Make user/location of Chukwa installation configurable by an
     external properties file. (Eric Yang via cdouglas)
 
+    HADOOP-4925. Make Chukwa sender properties configurable. (Ari Rabkin via
+    cdouglas)
+
 Release 0.19.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/core/branches/branch-0.20/src/contrib/chukwa/conf/chukwa-agent-conf.xml.template
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/contrib/chukwa/conf/chukwa-agent-conf.xml.template?rev=732649&r1=732648&r2=732649&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/contrib/chukwa/conf/chukwa-agent-conf.xml.template
(original)
+++ hadoop/core/branches/branch-0.20/src/contrib/chukwa/conf/chukwa-agent-conf.xml.template
Thu Jan  8 01:04:28 2009
@@ -41,4 +41,22 @@
     <value>5000</value>
     <description>the frequency interval for the agent to do checkpoints, in milliseconds</description>
   </property>
+
+  <property>
+    <name>chukwaAgent.sender.fastRetries</name>
+    <value>4</value>
+    <description>the number of post attempts to make to a single collector, before
marking it failed</description>
+  </property>
+
+  <property>
+    <name>chukwaAgent.collector.retries</name>
+    <value>144000</value>
+    <description>the number of attempts to find a working collector</description>
+  </property>
+
+  <property>
+    <name>chukwaAgent.collector.retryInterval</name>
+    <value>20000</value>
+    <description>the number of milliseconds to wait between searches for a collector</description>
+  </property>
 </configuration>

Modified: hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/connector/http/HttpConnector.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/connector/http/HttpConnector.java?rev=732649&r1=732648&r2=732649&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/connector/http/HttpConnector.java
(original)
+++ hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/connector/http/HttpConnector.java
Thu Jan  8 01:04:28 2009
@@ -112,7 +112,7 @@
 					"conf/collectors file", e);
 		}
 
-		connectorClient = new ChukwaHttpSender();
+		connectorClient = new ChukwaHttpSender(agent.getConfiguration());
 
 		if (argDestination != null) 
 		{

Modified: hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/sender/ChukwaHttpSender.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/sender/ChukwaHttpSender.java?rev=732649&r1=732648&r2=732649&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/sender/ChukwaHttpSender.java
(original)
+++ hadoop/core/branches/branch-0.20/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/sender/ChukwaHttpSender.java
Thu Jan  8 01:04:28 2009
@@ -40,6 +40,7 @@
 import org.apache.commons.httpclient.params.HttpMethodParams;
 import org.apache.hadoop.chukwa.Chunk;
 import org.apache.hadoop.chukwa.datacollection.adaptor.Adaptor;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.DataOutputBuffer;
 import org.apache.log4j.Logger;
 
@@ -52,9 +53,9 @@
  * <p> Will wait forever for collectors to come up. </p>
  */
 public class ChukwaHttpSender implements ChukwaSender{
-  static final int MAX_RETRIES_PER_COLLECTOR = 4; //fast retries, in http client
-  static final int SENDER_RETRIES = 14440; 
-  static final int WAIT_FOR_COLLECTOR_REBOOT = 20 * 1000; 
+  final int MAX_RETRIES_PER_COLLECTOR ; //fast retries, in http client
+  final int SENDER_RETRIES; 
+  final int WAIT_FOR_COLLECTOR_REBOOT; 
     //FIXME: this should really correspond to the timer in RetryListOfCollectors
   
   static Logger log = Logger.getLogger(ChukwaHttpSender.class);
@@ -114,12 +115,15 @@
     }
   }
 
-  public ChukwaHttpSender(){
+  public ChukwaHttpSender(Configuration c){
     //setup default collector
     ArrayList<String> tmp = new ArrayList<String>();
     this.collectors = tmp.iterator();
     log.info("added a single collector to collector list in ConnectorClient constructor,
it's hasNext is now: " + collectors.hasNext());
 
+    MAX_RETRIES_PER_COLLECTOR = c.getInt("chukwaAgent.sender.fastRetries", 4);
+    SENDER_RETRIES= c.getInt("chukwaAgent.sender.retries", 144000);
+    WAIT_FOR_COLLECTOR_REBOOT= c.getInt("chukwaAgent.sender.retryInterval", 20*1000);
   }
   
   /**



Mime
View raw message