chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r885634 - in /hadoop/chukwa/trunk: ./ src/java/org/apache/hadoop/chukwa/datacollection/agent/ src/java/org/apache/hadoop/chukwa/datacollection/sender/ src/java/org/apache/hadoop/chukwa/datacollection/writer/ src/java/org/apache/hadoop/chukw...
Date Tue, 01 Dec 2009 00:40:26 GMT
Author: asrabkin
Date: Tue Dec  1 00:39:59 2009
New Revision: 885634

URL: http://svn.apache.org/viewvc?rev=885634&view=rev
Log:
CHUKWA-418. Standardize logging. Mark adaptor IDs.

Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/ChukwaAgent.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/AsyncAckSender.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/AdaptorNamingUtils.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/DaemonWatcher.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestFileAdaptor.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgentConfig.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestAdaptorTimeout.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestBackpressure.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestDelayedAcks.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestFailedCollectorAck.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Tue Dec  1 00:39:59 2009
@@ -8,6 +8,8 @@
  
    IMPROVEMENTS
 
+    CHUKWA-418. Standardize logging. Mark adaptor IDs. (asrabkin)
+
     CHUKWA-207. Store HICC dashboard data in HDFS. (Eric Yang)
 
     CHUKWA-415. Read initial adaptors at start every time. (asrabkin)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java
Tue Dec  1 00:39:59 2009
@@ -131,6 +131,7 @@
         if (words.length < 2) {
           out.println("need to specify an adaptor to shut down, by number");
         } else {
+          santizeAdaptorName(out, words);
           long offset = agent.stopAdaptor(words[1], true);
           if (offset != -1)
             out.println("OK adaptor " + words[1] + " stopping gracefully at "
@@ -142,6 +143,7 @@
         if (words.length < 2) {
           out.println("need to specify an adaptor to shut down, by number");
         } else {
+          santizeAdaptorName(out, words);
           agent.stopAdaptor(words[1], false);
           out.println("OK adaptor " + words[1] + " stopped");
         }
@@ -184,6 +186,14 @@
       out.flush();
     }
 
+    private void santizeAdaptorName(PrintStream out, String[] words) {
+      if(!words[1].startsWith("adaptor_")) {
+        words[1] = "adaptor_" + words[1];
+        out.println("adaptor names should start with adaptor_; "
+            +"assuming you meant"+ words[1] );
+      }
+    }
+
   }
 
   /**

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=885634&r1=885633&r2=885634&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 Dec  1 00:39:59 2009
@@ -82,6 +82,10 @@
     public long offset() {
       return this.offset;
     }
+    
+    public String adaptorID() {
+      return id;
+    }
   }
 
   public static class AlreadyRunningException extends Exception {
@@ -337,7 +341,8 @@
           log.fatal("MD5 apparently doesn't work on your machine; bailing", e);
           shutdown(true);
         }
-      }
+      } else if(!adaptorID.startsWith("adaptor_"))
+        adaptorID = "adaptor_"+adaptorID;
       
       synchronized (adaptorsByName) {
         
@@ -349,7 +354,7 @@
         try {
           adaptor.start(adaptorID, dataType, offset, DataFactory
               .getInstance().getEventQueue(), this);
-          log.info("started a new adaptor, id = " + adaptorID);
+          log.info("started a new adaptor, id = " + adaptorID + " function=["+adaptor.toString()+"]");
           ChukwaAgent.agentMetrics.adaptorCount.set(adaptorsByName.size());
           ChukwaAgent.agentMetrics.addedAdaptor.inc();
           return adaptorID;
@@ -504,7 +509,7 @@
  * @return
  */
   public Map<String, String> getAdaptorList() {
-    Map<String, String> adaptors = new HashMap<String, String>();
+    Map<String, String> adaptors = new HashMap<String, String>(adaptorsByName.size());
     synchronized (adaptorsByName) {
       for (Map.Entry<String, Adaptor> a : adaptorsByName.entrySet()) {
         adaptors.put(a.getKey(), formatAdaptorStatus(a.getValue()));

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/AsyncAckSender.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/AsyncAckSender.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/AsyncAckSender.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/sender/AsyncAckSender.java
Tue Dec  1 00:39:59 2009
@@ -190,7 +190,7 @@
           else {
             ChukwaAgent.Offset o = agent.offset(fired.adaptor);
             if(o != null && fired.start > o.offset()) {
-              log.error("can't commit without ordering assumption");
+              log.error("can't commit "+ o.adaptorID() +  "  without ordering assumption");
               break; //don't commit
             }
             delayedOnFile.remove();
@@ -305,7 +305,8 @@
         if(!m.matches())
           log.warn("unexpected response: "+ resp.get(i));
         else
-          log.info("waiting for " + m.group(1) + " to hit " + m.group(2) + " before committing
"+ cle.adaptor);
+          log.info("waiting for " + m.group(1) + " to hit " + m.group(2) + 
+              " before committing "+ agent.getAdaptorName(cle.adaptor));
         
         String name = agent.getAdaptorName(cle.adaptor);
         if(name != null)//null name implies adaptor no longer running

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java
Tue Dec  1 00:39:59 2009
@@ -57,7 +57,6 @@
   static String localHostAddr = null;
   
   final Semaphore lock = new Semaphore(1, true);
-
   
   private FileSystem fs = null;
   private Configuration conf = null;
@@ -172,9 +171,6 @@
     
     calendar.setTimeInMillis(System.currentTimeMillis());
 
-    log.info("start Date [" + calendar.getTime() + "]");
-    log.info("Rotate from " + Thread.currentThread().getName());
-
     String newName = new java.text.SimpleDateFormat("yyyyddHHmmssSSS")
         .format(calendar.getTime());
     newName += localHostAddr + new java.rmi.server.UID().toString();

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/AdaptorNamingUtils.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/AdaptorNamingUtils.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/AdaptorNamingUtils.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/AdaptorNamingUtils.java Tue
Dec  1 00:39:59 2009
@@ -32,6 +32,7 @@
     md.update(dataType.getBytes());
     md.update(params.getBytes());
     StringBuilder sb = new StringBuilder();
+    sb.append("adaptor_");
     byte[] bytes = md.digest();
     for(int i=0; i < bytes.length; ++i) {
       if( (bytes[i] & 0xF0) == 0)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/DaemonWatcher.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/DaemonWatcher.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/DaemonWatcher.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/util/DaemonWatcher.java Tue Dec
 1 00:39:59 2009
@@ -37,9 +37,6 @@
   }
   
   public static void bailout(int status) {
-    if(instance != null) {
-      Runtime.getRuntime().removeShutdownHook(instance);
-    }
     System.exit(status);
   }
 }

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestFileAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestFileAdaptor.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestFileAdaptor.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestFileAdaptor.java
Tue Dec  1 00:39:59 2009
@@ -72,8 +72,9 @@
     
     assertEquals(0, agent.adaptorCount());
 
-    agent.processAddCommand("add test = FileAdaptor raw " +testFile.getCanonicalPath() +
" 0");
+    String name =agent.processAddCommand("add test = FileAdaptor raw " +testFile.getCanonicalPath()
+ " 0");
     assertEquals(1, agent.adaptorCount());
+    assertEquals(name, "adaptor_test");
     Chunk c = chunks.waitForAChunk(5000);
     assertNotNull(c);
     String dat = new String(c.getData());
@@ -93,8 +94,9 @@
         System.out.println("buzzed " + i + " times");
       
       assertEquals(0, agent.adaptorCount());
-      agent.processAddCommand("add test = FileAdaptor raw " +testFile.getCanonicalPath()
+ " 0");
+      String name = agent.processAddCommand("add test = FileAdaptor raw " +testFile.getCanonicalPath()
+ " 0");
       assertEquals(1, agent.adaptorCount());
+      assertEquals(name, "adaptor_test");
       Chunk c = chunks.waitForAChunk(5000);
       assertNotNull(c);
       String dat = new String(c.getData());
@@ -102,7 +104,7 @@
       assertTrue(dat.endsWith("9 abcdefghijklmnopqrstuvwxyz\n"));
       assertTrue(c.getDataType().equals("raw"));
       if(agent.adaptorCount() > 0)
-        agent.stopAdaptor("test", false);
+        agent.stopAdaptor("adaptor_test", false);
     }
     agent.shutdown();
   }

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java
Tue Dec  1 00:39:59 2009
@@ -44,9 +44,9 @@
     ChukwaAgent agent = new ChukwaAgent(conf);
     File testFile = makeTestFile("chukwaTest", 80);
     String adaptorId = agent
-        .processAddCommand("add test = org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
+        .processAddCommand("add adaptor_test = org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
             + " lines " + testFile + " 0");
-    assertTrue(adaptorId.equals("test"));
+    assertTrue(adaptorId.equals("adaptor_test"));
     System.out.println("getting a chunk...");
     Chunk c = chunks.waitForAChunk();
     assertTrue(c.getSeqID() == testFile.length());

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java
Tue Dec  1 00:39:59 2009
@@ -93,7 +93,7 @@
         System.out.println("buzzed " + i + " times");
       
       assertEquals(0, agent.adaptorCount());
-      agent.processAddCommand("add test = filetailer.FileTailingAdaptor raw " +testFile.getCanonicalPath()
+ " 0");
+      agent.processAddCommand("add adaptor_test = filetailer.FileTailingAdaptor raw " +testFile.getCanonicalPath()
+ " 0");
       assertEquals(1, agent.adaptorCount());
       Chunk c = chunks.waitForAChunk();
       String dat = new String(c.getData());
@@ -101,7 +101,7 @@
       assertTrue(dat.endsWith("9 abcdefghijklmnopqrstuvwxyz\n"));
       assertTrue(c.getDataType().equals("raw"));
       if(agent.adaptorCount() > 0)
-        agent.stopAdaptor("test", false);
+        agent.stopAdaptor("adaptor_test", false);
     }
     agent.shutdown();
   }

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java
Tue Dec  1 00:39:59 2009
@@ -51,7 +51,7 @@
     String adaptorId = agent
         .processAddCommand("add lr =org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
             + " lines " + testFile + " 0");
-    assertTrue(adaptorId.equals("lr"));
+    assertTrue(adaptorId.equals("adaptor_lr"));
     System.out.println("getting a chunk...");
     Chunk c = chunks.waitForAChunk();
     System.out.println("got chunk");

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=885634&r1=885633&r2=885634&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 Dec  1 00:39:59 2009
@@ -43,7 +43,7 @@
       File initialAdaptors = File.createTempFile("initial", "adaptors");
       initialAdaptors.deleteOnExit();
       ps = new PrintStream(new FileOutputStream(initialAdaptors));
-      ps.println("add testAdaptor= org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8
 raw 0 "
+      ps.println("add adaptor_testAdaptor= org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8
 raw 0 "
               + foo.getAbsolutePath() + " 0  ");
       ps.close();
 
@@ -62,8 +62,8 @@
       conn.start();
       assertEquals(1, agent.adaptorCount());// check that we processed initial
                                             // adaptors
-      assertNotNull(agent.getAdaptor("testAdaptor"));
-      assertTrue(agent.getAdaptor("testAdaptor").getCurrentStatus().contains("foo"));
+      assertNotNull(agent.getAdaptor("adaptor_testAdaptor"));
+      assertTrue(agent.getAdaptor("adaptor_testAdaptor").getCurrentStatus().contains("foo"));
 
       System.out
           .println("---------------------done with first run, now stopping");
@@ -85,8 +85,8 @@
       conn.start();
       assertEquals(2, agent.adaptorCount());// check that we processed initial
                                             // adaptors
-      assertNotNull(agent.getAdaptor("testAdaptor"));
-      assertTrue(agent.getAdaptor("testAdaptor").getCurrentStatus().contains("foo"));
+      assertNotNull(agent.getAdaptor("adaptor_testAdaptor"));
+      assertTrue(agent.getAdaptor("adaptor_testAdaptor").getCurrentStatus().contains("foo"));
       agent.shutdown();
       Thread.sleep(2000);
       System.out.println("---------------------done");

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestAdaptorTimeout.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestAdaptorTimeout.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestAdaptorTimeout.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestAdaptorTimeout.java
Tue Dec  1 00:39:59 2009
@@ -51,7 +51,7 @@
     conn.start();
     String resp = agent.processAddCommand("add constSend = " + ConstRateAdaptor.class.getCanonicalName()
+ 
         " testData "+ SEND_RATE + " 0");
-    assertTrue("constSend".equals(resp));
+    assertTrue("adaptor_constSend".equals(resp));
     Thread.sleep(TEST_DURATION_SECS * 1000);
     
     AsyncAckSender sender = (AsyncAckSender)conn.getSender();

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestBackpressure.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestBackpressure.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestBackpressure.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestBackpressure.java
Tue Dec  1 00:39:59 2009
@@ -69,12 +69,12 @@
     server.start();
     server.setStopAtShutdown(false);
     Thread.sleep(1000);
-    agent.processAddCommand("add constSend = " + ConstRateAdaptor.class.getCanonicalName()
+ 
+    agent.processAddCommand("add adaptor_constSend = " + ConstRateAdaptor.class.getCanonicalName()
+ 
         " testData "+ SEND_RATE + " 0");
-    assertNotNull(agent.getAdaptor("constSend"));
+    assertNotNull(agent.getAdaptor("adaptor_constSend"));
     Thread.sleep(TEST_DURATION_SECS * 1000);
 
-    String[] stat = agent.getAdaptorList().get("constSend").split(" ");
+    String[] stat = agent.getAdaptorList().get("adaptor_constSend").split(" ");
     long kbytesPerSec = Long.valueOf(stat[stat.length -1]) / TEST_DURATION_SECS / 1000;
     System.out.println("data rate was " + kbytesPerSec + " kb /second");
     assertTrue(kbytesPerSec < WRITE_RATE_KB); //write rate should throttle sends

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestDelayedAcks.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestDelayedAcks.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestDelayedAcks.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestDelayedAcks.java
Tue Dec  1 00:39:59 2009
@@ -208,15 +208,15 @@
       conn.start();
       String resp = agent.processAddCommand("add constSend = " + ConstRateAdaptor.class.getCanonicalName()
+ 
           " testData "+ SEND_RATE + " 0");
-      assertTrue("constSend".equals(resp));
+      assertTrue("adaptor_constSend".equals(resp));
       Thread.sleep(END2END_TEST_SECS * 1000);
 
       //do the shutdown directly, here, so that acks are still processed.
-      assertNotNull(agent.getAdaptor("constSend"));
-      long bytesOutput = agent.getAdaptor("constSend").shutdown();
+      assertNotNull(agent.getAdaptor("adaptor_constSend"));
+      long bytesOutput = agent.getAdaptor("adaptor_constSend").shutdown();
       Thread.sleep(CLIENT_SCANPERIOD + SERVER_SCANPERIOD + ROTATEPERIOD + 3000);
       
-      String[] stat = agent.getAdaptorList().get("constSend").split(" ");
+      String[] stat = agent.getAdaptorList().get("adaptor_constSend").split(" ");
       long bytesCommitted = Long.valueOf(stat[stat.length -1]);
       
       long bytesPerSec = bytesOutput / (1000 * END2END_TEST_SECS);

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestFailedCollectorAck.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestFailedCollectorAck.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestFailedCollectorAck.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/collector/TestFailedCollectorAck.java
Tue Dec  1 00:39:59 2009
@@ -76,15 +76,15 @@
     //FIXME: somehow need to clue in commit checker which paths to check.
     //       Somehow need 
 
-    String resp = agent.processAddCommand("add constSend = " + ConstRateAdaptor.class.getCanonicalName()
+ 
+    String resp = agent.processAddCommand("add adaptor_constSend = " + ConstRateAdaptor.class.getCanonicalName()
+ 
         " testData "+ TestDelayedAcks.SEND_RATE + " 12345 0");
-    assertTrue("constSend".equals(resp));
+    assertTrue("adaptor_constSend".equals(resp));
     Thread.sleep(10 * 1000);
     collector1_s.stop();
     Thread.sleep(10 * 1000);
     SeqFileWriter.ENABLE_ROTATION_ON_CLOSE = true;
 
-    String[] stat = agent.getAdaptorList().get("constSend").split(" ");
+    String[] stat = agent.getAdaptorList().get("adaptor_constSend").split(" ");
     long bytesCommitted = Long.valueOf(stat[stat.length -1]);
     assertTrue(bytesCommitted > 0);
     agent.shutdown();

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java?rev=885634&r1=885633&r2=885634&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java
Tue Dec  1 00:39:59 2009
@@ -125,7 +125,7 @@
     read = dis.read(data);
     String rcvd = new String(data);
     System.out.println("got: " + rcvd);
-    assertTrue(rcvd.equals("hostNameFoo dataTypeFoo streamName 4\ntext"));
+    assertTrue("hostNameFoo dataTypeFoo streamName 4\ntext".equals(rcvd));
     s3.close();
     dis.close();
     



Mime
View raw message