chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r883563 - in /hadoop/chukwa/trunk: CHANGES.txt src/java/org/apache/hadoop/chukwa/datacollection/agent/ChukwaAgent.java src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgentConfig.java
Date Tue, 24 Nov 2009 01:15:46 GMT
Author: asrabkin
Date: Tue Nov 24 01:15:42 2009
New Revision: 883563

URL: http://svn.apache.org/viewvc?rev=883563&view=rev
Log:
CHUKWA-415. Read initial adaptors at start every time.

Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/ChukwaAgent.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgentConfig.java

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=883563&r1=883562&r2=883563&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Tue Nov 24 01:15:42 2009
@@ -8,6 +8,8 @@
  
    IMPROVEMENTS
 
+    CHUKWA-415. Read initial adaptors at start every time. (asrabkin)
+
     CHUKWA-413. Improve admin guide. (asrabkin)
 
     CHUKWA-345. Remove redundant 'application' field from Chunk API. (asrabkin)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/ChukwaAgent.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/ChukwaAgent.java?rev=883563&r1=883562&r2=883563&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/ChukwaAgent.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/ChukwaAgent.java
Tue Nov 24 01:15:42 2009
@@ -240,10 +240,8 @@
     }
 
     try {
-      if (initialAdaptors != null && initialAdaptors.exists()
-          && checkpointNumber == 0)
-        readAdaptorsFile(initialAdaptors); // don't read after checkpoint
-                                           // restore
+      if (initialAdaptors != null && initialAdaptors.exists())
+        readAdaptorsFile(initialAdaptors); 
     } catch (IOException e) {
       log.warn("couldn't read user-specified file "
           + initialAdaptors.getAbsolutePath());
@@ -425,6 +423,7 @@
 
   private void readAdaptorsFile(File checkpoint) throws FileNotFoundException,
       IOException {
+    log.info("starting adaptors listed in " + checkpoint.getAbsolutePath());
     BufferedReader br = new BufferedReader(new InputStreamReader(
         new FileInputStream(checkpoint)));
     String cmd = null;

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgentConfig.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgentConfig.java?rev=883563&r1=883562&r2=883563&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgentConfig.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgentConfig.java
Tue Nov 24 01:15:42 2009
@@ -72,9 +72,8 @@
       assertEquals(0, agent.adaptorCount());
       // at this point, there should be a checkpoint file with a tailer reading
       // foo.
-      // we're going to rewrite initial adaptors to read bar; but after reboot
-      // we should
-      // still only be looking at foo.
+      // we're going to rewrite initial adaptors to read bar; after reboot
+      // we should  be looking at both foo andn bar.
       ps = new PrintStream(new FileOutputStream(initialAdaptors, false));// overwrite
       ps.println("add bar= org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8
 raw 0 "
               + bar.getAbsolutePath() + " 0  ");
@@ -84,7 +83,7 @@
       agent = new ChukwaAgent(conf);
       conn = new ConsoleOutConnector(agent, true);
       conn.start();
-      assertEquals(1, agent.adaptorCount());// check that we processed initial
+      assertEquals(2, agent.adaptorCount());// check that we processed initial
                                             // adaptors
       assertNotNull(agent.getAdaptor("testAdaptor"));
       assertTrue(agent.getAdaptor("testAdaptor").getCurrentStatus().contains("foo"));



Mime
View raw message