chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r784290 - in /hadoop/chukwa/branches/chukwa-0.2: CHANGES.txt src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java
Date Fri, 12 Jun 2009 22:01:32 GMT
Author: asrabkin
Date: Fri Jun 12 22:01:28 2009
New Revision: 784290

URL: http://svn.apache.org/viewvc?rev=784290&view=rev
Log:
CHUKWA-291. Append slash to collector pathnames.

Modified:
    hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt
    hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
    hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java

Modified: hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt?rev=784290&r1=784289&r2=784290&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt (original)
+++ hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt Fri Jun 12 22:01:28 2009
@@ -62,6 +62,8 @@
 
   BUG FIXES
 
+    CHUKWA-291. Append slash to collector paths. (asrabkin)
+
     CHUKWA-287. Fix crash on collector startup when no args present. (Eric Yang via asrabkin)
 
     CHUKWA-273. Agents correctly use configured collector port numbers. (asrabkin)

Modified: hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java?rev=784290&r1=784289&r2=784290&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
(original)
+++ hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
Fri Jun 12 22:01:28 2009
@@ -98,9 +98,10 @@
       pool.setMaxThreads(THREADS);
       jettyServer.setThreadPool(pool);
       
-      // Add the cCllector servlet to server
+      // Add the collector servlet to server
       Context root = new Context(jettyServer, "/", Context.SESSIONS);
-      root.addServlet(new ServletHolder(new ServletCollector(conf)), "/chukwa");
+      root.addServlet(new ServletHolder(new ServletCollector(conf)), "/*");
+      root.setAllowNullPathInfo(false);
 
       // Add in any user-specified servlets
       for(Map.Entry<String, HttpServlet> e: servletsToAdd.entrySet()) {

Modified: hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java?rev=784290&r1=784289&r2=784290&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java
(original)
+++ hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java
Fri Jun 12 22:01:28 2009
@@ -53,23 +53,27 @@
 
     try {
       BufferedReader br = new BufferedReader(new FileReader(collectorFile));
-      String line;
+      String line, parsedline;
       while ((line = br.readLine()) != null) {
         if (!line.contains("://")) {
           // no protocol, assume http
           if (line.matches(".*:\\d+")) {
-            collectors.add("http://" + line);
+            parsedline = "http://" + line+"/";
           } else {
-            collectors.add("http://" + line + ":" + portNo);
+            parsedline = "http://" + line + ":" + portNo;
           }
         } else {
           if (line.matches(".*:\\d+")) {
-            collectors.add(line);
+            parsedline = line;
           } else {
-            collectors.add(line + ":" + portNo);
+            parsedline = line + ":" + portNo;
           }
         }
+        if(!parsedline.matches(".*\\w/.*")) //no resource name
+          parsedline = parsedline+"/";
+        collectors.add(parsedline);
       }
+      
       br.close();
     } catch (FileNotFoundException e) {
       System.err



Mime
View raw message