chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r784293 - in /hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection: collector/CollectorStub.java sender/RetryListOfCollectors.java
Date Fri, 12 Jun 2009 22:06:48 GMT
Author: asrabkin
Date: Fri Jun 12 22:06:48 2009
New Revision: 784293

URL: http://svn.apache.org/viewvc?rev=784293&view=rev
Log:
CHUKWA-291. Append slash to collector pathnames.  This time for real.

Modified:
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java?rev=784293&r1=784292&r2=784293&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
Fri Jun 12 22:06:48 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/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java?rev=784293&r1=784292&r2=784293&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/RetryListOfCollectors.java
Fri Jun 12 22:06:48 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