chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r783215 - in /hadoop/chukwa/trunk: ./ src/java/org/apache/hadoop/chukwa/datacollection/adaptor/ src/java/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/ src/java/org/apache/hadoop/chukwa/datacollection/agent/ src/test/org/apache...
Date Wed, 10 Jun 2009 06:01:28 GMT
Author: asrabkin
Date: Wed Jun 10 06:01:26 2009
New Revision: 783215

URL: http://svn.apache.org/viewvc?rev=783215&view=rev
Log:
CHUKWA-268. Adaptor manager interface, Agent class refactoring.

Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/Adaptor.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/ExecAdaptor.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/FileAdaptor.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/FileTailingAdaptor.java
    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/test/org/apache/hadoop/chukwa/datacollection/adaptor/ChukwaTestAdaptor.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.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/TestFileExpirationPolicy.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptorBigRecord.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/adaptor/filetailer/TestRawAdaptor.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgent.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgentConfig.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestCmd.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/validationframework/ChukwaAgentToCollectorValidator.java

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Wed Jun 10 06:01:26 2009
@@ -20,6 +20,8 @@
 
   IMPROVEMENTS
 
+    CHUKWA-268. Expose adaptor manager interface, refactor Agent class hierarchy. (asrabkin)
+
     CHUKWA-259. More flexible CollectorStub. (asrabkin)
 
     CHUKWA-274. Improve rate calculation for accumulated values for visualization. (Eric
Yang)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/Adaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/Adaptor.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/Adaptor.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/Adaptor.java
Wed Jun 10 06:01:26 2009
@@ -20,6 +20,7 @@
 
 
 import org.apache.hadoop.chukwa.datacollection.ChunkReceiver;
+import org.apache.hadoop.chukwa.datacollection.agent.AdaptorManager;
 
 /**
  * An adaptor is a component that runs within the Local Agent, producing chunks
@@ -47,7 +48,7 @@
    * @throws AdaptorException
    */
   public void start(long adaptorID, String type, String status, long offset,
-      ChunkReceiver dest) throws AdaptorException;
+      ChunkReceiver dest, AdaptorManager c) throws AdaptorException;
 
   /**
    * Return the adaptor's state Should not include class name, datatype or byte

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/ExecAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/ExecAdaptor.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/ExecAdaptor.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/ExecAdaptor.java
Wed Jun 10 06:01:26 2009
@@ -39,19 +39,33 @@
  * 0
  * 
  */
-public class ExecAdaptor extends ExecPlugin implements Adaptor {
-
+public class ExecAdaptor extends  AbstractAdaptor {
+  
+  static class EmbeddedExec extends ExecPlugin {
+
+    String cmd;
+    
+    public EmbeddedExec(String c) {
+      cmd = c;
+    }
+    
+    @Override
+    public String getCmde() {
+      return cmd;
+    }
+  }
+  
+  EmbeddedExec exec;
   static final boolean FAKE_LOG4J_HEADER = true;
   static final boolean SPLIT_LINES = false;
-  protected long adaptorID = 0;
   static Logger log = Logger.getLogger(ExecAdaptor.class);
-
+  
   class RunToolTask extends TimerTask {
     public void run() {
-      JSONObject o = execute();
+      JSONObject o = exec.execute();
       try {
 
-        if (o.getInt("status") == statusKO)
+        if (o.getInt("status") == ExecPlugin.statusKO)
           hardStop();
 
         // FIXME: downstream customers would like timestamps here.
@@ -97,8 +111,6 @@
   };
 
   String cmd;
-  String type;
-  ChunkReceiver dest;
   final java.util.Timer timer;
   long period = 5 * 1000;
   volatile long sendOffset = 0;
@@ -118,7 +130,7 @@
 
   @Override
   public void hardStop() throws AdaptorException {
-    super.stop();
+    exec.stop();
     timer.cancel();
   }
 
@@ -126,7 +138,7 @@
   public long shutdown() throws AdaptorException {
     try {
       timer.cancel();
-      super.waitFor(); // wait for last data to get pushed out
+      exec.waitFor(); // wait for last data to get pushed out
     } catch (InterruptedException e) {
       return sendOffset;
     }
@@ -134,8 +146,7 @@
   }
 
   @Override
-  public void start(long adaptorID, String type, String status, long offset,
-      ChunkReceiver dest) throws AdaptorException {
+  public void start(String status, long offset) throws AdaptorException {
 
     int spOffset = status.indexOf(' ');
     if (spOffset > 0) {
@@ -149,23 +160,13 @@
       }
     } else
       cmd = status;
-    this.adaptorID = adaptorID;
-    this.type = type;
-    this.dest = dest;
     this.sendOffset = offset;
 
-    TimerTask exec = new RunToolTask();
-    timer.schedule(exec, 0L, period);
+    this.exec = new EmbeddedExec(cmd);
+    TimerTask execTimer = new RunToolTask();
+    timer.schedule(execTimer, 0L, period);
   }
 
-  @Override
-  public String getCmde() {
-    return cmd;
-  }
 
-  @Override
-  public String getType() {
-    return type;
-  }
 
 }

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/FileAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/FileAdaptor.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/FileAdaptor.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/FileAdaptor.java
Wed Jun 10 06:01:26 2009
@@ -60,7 +60,7 @@
     // iterations are much more common than adding a new adaptor
     adaptors = new CopyOnWriteArrayList<FileAdaptor>();
 
-    this.setDaemon(true);
+    setDaemon(true);
     start();// start the FileAdaptorTailer thread
   }
   @Override
@@ -111,7 +111,7 @@
 /**
  * File Adaptor push small size file in one chunk to collector
  */
-public class FileAdaptor implements Adaptor {
+public class FileAdaptor extends AbstractAdaptor {
 
   static Logger log = Logger.getLogger(FileAdaptor.class);
   static FileAdaptorTailer tailer = null;
@@ -139,9 +139,6 @@
   protected File toWatch;
   protected RandomAccessFile reader = null;
   protected long fileReadOffset;
-  protected String type;
-  protected ChunkReceiver dest;
-  protected long adaptorID;
   protected boolean shutdownCalled = false;
   
   /**
@@ -149,14 +146,10 @@
    */
   private long offsetOfFirstByte = 0;
 
-  public void start(long adaptorID, String type, String params, long bytes,
-      ChunkReceiver dest) {
+  public void start(String params, long bytes) {
     // in this case params = filename
     log.info("adaptor id: " + adaptorID + " started file adaptor on file "
         + params);
-    this.adaptorID = adaptorID;
-    this.type = type;
-    this.dest = dest;
     this.startTime = System.currentTimeMillis();
     this.timeOut = startTime + TIMEOUT_PERIOD;
     
@@ -193,7 +186,7 @@
          long fileTime = toWatch.lastModified();
          int bytesUsed = extractRecords(dest, 0, buf, fileTime);
          this.fileReadOffset = bytesUsed;
-         unregisterFromAgent();
+         deregisterAndStop(false);
          cleanUp();
        }catch(Exception e) {
          log.warn("Exception while trying to read: " + toWatch.getAbsolutePath(),e);
@@ -212,7 +205,7 @@
     } else {
       if (now > timeOut) {
         log.warn("Couldn't read this file: " + toWatch.getAbsolutePath());
-        unregisterFromAgent();
+        deregisterAndStop(false);
         cleanUp() ;
       }
     }
@@ -230,17 +223,6 @@
     } 
   }
   
-  private void unregisterFromAgent() {
-    ChukwaAgent agent = ChukwaAgent.getAgent();
-    if (agent != null) {
-      agent.stopAdaptor(adaptorID, false);
-      
-    } else {
-      log.warn("Agent is null, cannot unregister " + toWatch.getAbsolutePath());
-    }
- 
-  }
-  
   
   /**
    * We want to keep trying
@@ -287,11 +269,6 @@
   }
 
   @Override
-  public String getType() {
-    return type;
-  }
-
-  @Override
   public String getCurrentStatus() throws AdaptorException {
     return type.trim() + " " + offsetOfFirstByte + " " + toWatch.getPath()
         + " " + fileReadOffset;

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/FileTailingAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/FileTailingAdaptor.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/FileTailingAdaptor.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/FileTailingAdaptor.java
Wed Jun 10 06:01:26 2009
@@ -26,8 +26,7 @@
 import java.util.regex.Pattern;
 import org.apache.hadoop.chukwa.ChunkImpl;
 import org.apache.hadoop.chukwa.datacollection.ChunkReceiver;
-import org.apache.hadoop.chukwa.datacollection.adaptor.Adaptor;
-import org.apache.hadoop.chukwa.datacollection.adaptor.AdaptorException;
+import org.apache.hadoop.chukwa.datacollection.adaptor.*;
 import org.apache.hadoop.chukwa.datacollection.agent.ChukwaAgent;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.log4j.Logger;
@@ -38,7 +37,7 @@
  * file. Subclasses can alter this behavior by overriding extractRecords().
  * 
  */
-public class FileTailingAdaptor implements Adaptor {
+public class FileTailingAdaptor extends AbstractAdaptor {
 
   static Logger log;
 
@@ -61,10 +60,7 @@
    * next PHYSICAL offset to read
    */
   protected long fileReadOffset;
-  protected String type;
-  private ChunkReceiver dest;
   protected RandomAccessFile reader = null;
-  protected long adaptorID;
 
   /**
    * The logical offset of the first byte of the file
@@ -78,12 +74,8 @@
     log = Logger.getLogger(FileTailingAdaptor.class);
   }
 
-  public void start(long adaptorID, String type, String params, long bytes,
-      ChunkReceiver dest) {
+  public void start(String params, long bytes) {
     // in this case params = filename
-    this.adaptorID = adaptorID;
-    this.type = type;
-    this.dest = dest;
     this.attempts = 0;
 
     Pattern cmd = Pattern.compile("(\\d+)\\s+(.+)\\s?");
@@ -191,14 +183,8 @@
           return false;
         }
 
-        ChukwaAgent agent = ChukwaAgent.getAgent();
-        if (agent != null) {
-          agent.stopAdaptor(adaptorID, false);
-        } else {
-          log.info("Agent is null, running in default mode");
-        }
+        deregisterAndStop(false);
         return false;
-
       } else if (!toWatch.exists() || !toWatch.canRead()) {
         if (adaptorInError == false) {
           long now = System.currentTimeMillis();
@@ -309,8 +295,7 @@
         // So log.warn, and drop current buffer so we can keep moving
         // instead of being stopped at that point for ever
         if (bytesUsed == 0 && bufferRead == MAX_READ_SIZE) {
-          log
-              .warn("bufferRead == MAX_READ_SIZE AND bytesUsed == 0, droping current buffer:
startOffset="
+          log.warn("bufferRead == MAX_READ_SIZE AND bytesUsed == 0, droping current buffer:
startOffset="
                   + curOffset
                   + ", MAX_READ_SIZE="
                   + MAX_READ_SIZE
@@ -363,9 +348,5 @@
     return buf.length;
   }
 
-  @Override
-  public String getType() {
-    return type;
-  }
 
 }

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=783215&r1=783214&r2=783215&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
Wed Jun 10 06:01:26 2009
@@ -78,6 +78,7 @@
         while ((cmd = br.readLine()) != null) {
           processCommand(cmd, out);
         }
+        connection.close();
         if (log.isDebugEnabled()) {
           log.debug("control connection closed");
         }
@@ -86,6 +87,9 @@
           log.info("control socket closed");
       } catch (IOException e) {
         log.warn("a control connection broke", e);
+        try {
+          connection.close();
+        } catch(Exception ex) {}
       }
     }
 
@@ -117,7 +121,7 @@
       } else if (words[0].equalsIgnoreCase("close")) {
         connection.close();
       } else if (words[0].equalsIgnoreCase("add")) {
-        long newID = agent.processCommand(cmd);
+        long newID = agent.processAddCommand(cmd);
         if (newID != -1)
           out.println("OK add completed; new ID is " + newID);
         else
@@ -146,25 +150,20 @@
         agent.getConnector().reloadConfiguration();
         out.println("OK reloadCollectors done");
       } else if (words[0].equalsIgnoreCase("list")) {
-        Map<Long, Adaptor> adaptorsByNumber = agent.getAdaptorList();
+        java.util.Map<Long, String> adaptorList = agent.getAdaptorList();
 
         if (log.isDebugEnabled()) {
-          log.debug("number of adaptors: " + adaptorsByNumber.size());
+          log.debug("number of adaptors: " + adaptorList.size());
         }
 
-        synchronized (adaptorsByNumber) {
-          for (Map.Entry<Long, Adaptor> a : adaptorsByNumber.entrySet()) {
-            try {
-              out.print(a.getKey());
-              out.print(") ");
-              out.print(" ");
-              out.println(formatAdaptorStatus(a.getValue()));
-            } catch (AdaptorException e) {
-              log.error(e);
-            }
+        for (Map.Entry<Long, String> a: adaptorList.entrySet()) {
+            out.print(a.getKey());
+            out.print(") ");
+            out.print(" ");
+            out.println(a.getValue());
           }
           out.println("");
-        }
+        
       } else if (words[0].equalsIgnoreCase("stopagent")) {
         out.println("stopping agent process.");
         connection.close();
@@ -196,9 +195,7 @@
     this.setName("control socket listener");
   }
 
-  public String formatAdaptorStatus(Adaptor a) throws AdaptorException {
-    return a.getClass().getCanonicalName() + " " + a.getCurrentStatus();
-  }
+
 
   /**
    * Binds to socket, starts looping listening for commands

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=783215&r1=783214&r2=783215&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
Wed Jun 10 06:01:26 2009
@@ -30,10 +30,7 @@
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
+import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -55,9 +52,9 @@
  * be embeddable, for use in testing.
  * 
  */
-public class ChukwaAgent {
+public class ChukwaAgent implements AdaptorManager {
   // boolean WRITE_CHECKPOINTS = true;
-  static final AgentMetrics agentMetrics = new AgentMetrics("ChukwaAgent", "chukwaAgent");;
+  static final AgentMetrics agentMetrics = new AgentMetrics("ChukwaAgent", "chukwaAgent");
   static Logger log = Logger.getLogger(ChukwaAgent.class);
   static ChukwaAgent agent = null;
 
@@ -91,6 +88,7 @@
   private final Map<Adaptor, Offset> adaptorPositions;
 
   // basically only used by the control socket thread.
+  //must be locked before access
   private final Map<Long, Adaptor> adaptorsByNumber;
 
   private File checkpointDir; // lock this object to indicate checkpoint in
@@ -174,8 +172,11 @@
   /**
    * @return the number of running adaptors inside this local agent
    */
+  @Override
   public int adaptorCount() {
-    return adaptorsByNumber.size();
+    synchronized(adaptorsByNumber) {
+      return adaptorsByNumber.size();
+    }
   }
 
   public ChukwaAgent() throws AlreadyRunningException {
@@ -272,7 +273,7 @@
   // but can be arbitrarily many space
   // delimited agent specific params )
   // 4) offset
-  Pattern addCmdPattern = Pattern.compile("[aA][dD][dD]\\s+" // command "add",
+  private Pattern addCmdPattern = Pattern.compile("[aA][dD][dD]\\s+" // command "add",
                                                              // any case, plus
                                                              // at least one
                                                              // space
@@ -284,7 +285,14 @@
       + ")?" // end non-matching group for params; group is optional
       + "(\\d+)\\s*"); // finally, an offset and some trailing whitespace
 
-  public long processCommand(String cmd) {
+  /**
+   * Most of the Chukwa wire protocol is implemented in @link{AgentControlSocketListener}
+   * 
+   * Unlike the rest of the chukwa wire protocol, add commands can appear in
+   * initial_adaptors and checkpoint files. So it makes sense to handle them here.
+   * 
+   */
+  public long processAddCommand(String cmd) {
     Matcher m = addCmdPattern.matcher(cmd);
     if (m.matches()) {
       long offset; // check for obvious errors first
@@ -321,7 +329,7 @@
         needNewCheckpoint = true;
         try {
           adaptor.start(adaptorID, dataType, params, offset, DataFactory
-              .getInstance().getEventQueue());
+              .getInstance().getEventQueue(), this);
           log.info("started a new adaptor, id = " + adaptorID);
           ChukwaAgent.agentMetrics.adaptorCount.set(adaptorsByNumber.size());
           ChukwaAgent.agentMetrics.addedAdaptor.inc();
@@ -351,7 +359,7 @@
    * @return true if the restore succeeded
    * @throws IOException
    */
-  public boolean restoreFromCheckpoint() throws IOException {
+  private boolean restoreFromCheckpoint() throws IOException {
     synchronized (checkpointDir) {
       String[] checkpointNames = checkpointDir.list(new FilenameFilter() {
         public boolean accept(File dir, String name) {
@@ -398,7 +406,7 @@
         new FileInputStream(checkpoint)));
     String cmd = null;
     while ((cmd = br.readLine()) != null)
-      processCommand(cmd);
+      processAddCommand(cmd);
     br.close();
   }
 
@@ -407,7 +415,7 @@
    * 
    * @throws IOException
    */
-  public void writeCheckpoint() throws IOException {
+  private void writeCheckpoint() throws IOException {
     needNewCheckpoint = false;
     synchronized (checkpointDir) {
       log.info("writing checkpoint " + checkpointNumber);
@@ -417,14 +425,8 @@
       PrintWriter out = new PrintWriter(new BufferedWriter(
           new OutputStreamWriter(fos)));
 
-      for (Map.Entry<Adaptor, Offset> stat : adaptorPositions.entrySet()) {
-        try {
-          Adaptor a = stat.getKey();
-          out.print("ADD " + a.getClass().getCanonicalName());
-          out.println(" " + a.getCurrentStatus());
-        } catch (AdaptorException e) {
-          e.printStackTrace();
-        }// don't try to recover from bad adaptor yet
+      for (Map.Entry<Long, String> stat : getAdaptorList().entrySet()) {
+          out.print("ADD " + stat.getValue());
       }
 
       out.close();
@@ -450,12 +452,12 @@
       log.info("got commit up to " + uuid + " on " + src + " = " + o.id);
     } else {
       log.warn("got commit up to " + uuid + "  for adaptor " + src
-          + " that doesn't appear to be running: " + adaptorsByNumber.size()
+          + " that doesn't appear to be running: " + adaptorCount()
           + " total");
     }
   }
 
-  class CheckpointTask extends TimerTask {
+  private class CheckpointTask extends TimerTask {
     public void run() {
       try {
         if (needNewCheckpoint) {
@@ -467,9 +469,28 @@
     }
   }
 
-  // for use only by control socket.
-  public Map<Long, Adaptor> getAdaptorList() {
-    return adaptorsByNumber;
+  
+  private String formatAdaptorStatus(Adaptor a) throws AdaptorException {
+    return a.getClass().getCanonicalName() + " " + a.getCurrentStatus();
+  }
+  
+/**
+ * Expose the adaptor list.  Keys are adaptor ID numbers, values are the 
+ * adaptor status strings.
+ * @return
+ */
+  public Map<Long, String> getAdaptorList() {
+    Map<Long, String> adaptors = new HashMap<Long, String>();
+    synchronized (adaptorsByNumber) {
+      for (Map.Entry<Long, Adaptor> a : adaptorsByNumber.entrySet()) {
+        try {
+          adaptors.put(a.getKey(), formatAdaptorStatus(a.getValue()));
+        } catch (AdaptorException e) {
+          log.error(e);
+        }
+      }
+    }
+    return adaptors;
   }
 
   /**
@@ -521,15 +542,23 @@
     return offset;
   }
 
+  @Override
   public Configuration getConfiguration() {
     return conf;
   }
+  
+  @Override
+  public Adaptor getAdaptor(long l) {
+    synchronized(adaptorsByNumber) {
+      return adaptorsByNumber.get(l);
+    }
+  }
 
-  public Connector getConnector() {
+  Connector getConnector() {
     return connector;
   }
 
-  protected static Configuration readConfig() {
+  private static Configuration readConfig() {
     Configuration conf = new Configuration();
 
     String chukwaHomeName = System.getenv("CHUKWA_HOME");
@@ -600,14 +629,14 @@
    * @param a the adaptor in question
    * @return that adaptor's last-checkpointed offset
    */
-  public long getOffset(Adaptor a) {
+  long getOffset(Adaptor a) { //FIXME: do we need this method?
     return adaptorPositions.get(a).offset;
   }
 
   /**
    * Returns the control socket for this agent.
    */
-  AgentControlSocketListener getControlSock() {
+  private AgentControlSocketListener getControlSock() {
     return controlSock;
   }
 }

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/ChukwaTestAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/ChukwaTestAdaptor.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/ChukwaTestAdaptor.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/ChukwaTestAdaptor.java
Wed Jun 10 06:01:26 2009
@@ -21,10 +21,8 @@
 
 import org.apache.hadoop.chukwa.datacollection.ChunkReceiver;
 
-public class ChukwaTestAdaptor implements Adaptor {
+public class ChukwaTestAdaptor extends AbstractAdaptor {
 
-  private long adaptorId = 0l;
-  private String type = null;
   private String params = null;
   private long startOffset = 0l;
   private ChunkReceiver dest = null;
@@ -54,28 +52,16 @@
   }
 
   @Override
-  public void start(long adaptorID, String type, String params, long offset,
-      ChunkReceiver dest) throws AdaptorException {
-    this.adaptorId = adaptorID;
-    this.type = type;
+  public void start(String params, long offset) throws AdaptorException {
     this.params = params;
     this.startOffset = offset;
-    this.dest = dest;
-    System.out.println("adaptorId [" + adaptorId + "]");
+    System.out.println("adaptorId [" + adaptorID + "]");
     System.out.println("type [" + type + "]");
     System.out.println("params [" + params + "]");
     System.out.println("startOffset [" + startOffset + "]");
 
   }
 
-  public String getType() {
-    return type;
-  }
-
-  public void setType(String type) {
-    this.type = type;
-  }
-
   public String getParams() {
     return params;
   }
@@ -88,24 +74,5 @@
     return startOffset;
   }
 
-  public void setStartOffset(long startOffset) {
-    this.startOffset = startOffset;
-  }
-
-  public long getAdaptorId() {
-    return adaptorId;
-  }
-
-  public void setAdaptorId(long adaptorId) {
-    this.adaptorId = adaptorId;
-  }
-
-  public ChunkReceiver getDest() {
-    return dest;
-  }
-
-  public void setDest(ChunkReceiver dest) {
-    this.dest = dest;
-  }
 
 }

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java
Wed Jun 10 06:01:26 2009
@@ -36,7 +36,7 @@
     try {
       ChukwaAgent agent = new ChukwaAgent();
       agent
-          .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.ExecAdaptor
ps ps aux 0");
+          .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.ExecAdaptor
ps ps aux 0");
 
       Chunk c = chunks.waitForAChunk();
       System.out.println(new String(c.getData()));

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=783215&r1=783214&r2=783215&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
Wed Jun 10 06:01:26 2009
@@ -23,7 +23,7 @@
     ChukwaAgent agent = new ChukwaAgent();
     File testFile = makeTestFile("chukwaTest", 80);
     long adaptorId = agent
-        .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
+        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
             + " lines " + testFile + " 0");
     assertTrue(adaptorId != -1);
     System.out.println("getting a chunk...");

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileExpirationPolicy.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileExpirationPolicy.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileExpirationPolicy.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileExpirationPolicy.java
Wed Jun 10 06:01:26 2009
@@ -1,6 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.hadoop.chukwa.datacollection.adaptor.filetailer;
 
-
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -30,15 +46,15 @@
       FileTailingAdaptor.GRACEFUL_PERIOD = 30 * 1000;
 
       long adaptorId = agent
-          .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped
MyType 0 /myWrongPath"
+          .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped
MyType 0 /myWrongPath"
               + System.currentTimeMillis() + " 0");
 
       assertTrue(adaptorId != -1);
 
-      assertTrue(agent.getAdaptorList().containsKey(adaptorId) == true);
+      assertNotNull(agent.getAdaptor(adaptorId));
 
       Thread.sleep(FileTailingAdaptor.GRACEFUL_PERIOD + 10000);
-      assertTrue(agent.getAdaptorList().containsKey(adaptorId) == false);
+      assertNull(agent.getAdaptor(adaptorId));
 
     } catch (Exception e) {
       Assert.fail("Exception in TestFileExpirationPolicy");
@@ -76,18 +92,18 @@
 
       FileTailingAdaptor.GRACEFUL_PERIOD = 30 * 1000;
       long adaptorId = agent
-          .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped
MyType 0 "
+          .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped
MyType 0 "
               + logFile + " 0");
 
       assertTrue(adaptorId != -1);
 
-      assertTrue(agent.getAdaptorList().containsKey(adaptorId) == true);
+      assertNotNull(agent.getAdaptor(adaptorId));
 
       Thread.sleep(10000);
       testFile.delete();
 
       Thread.sleep(FileTailingAdaptor.GRACEFUL_PERIOD + 10000);
-      assertTrue(agent.getAdaptorList().containsKey(adaptorId) == false);
+      assertNull(agent.getAdaptor(adaptorId));
       agent.shutdown();
     } catch (Exception e) {
       Assert.fail("Exception in TestFileExpirationPolicy");

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptorBigRecord.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptorBigRecord.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptorBigRecord.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptorBigRecord.java
Wed Jun 10 06:01:26 2009
@@ -1,6 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.hadoop.chukwa.datacollection.adaptor.filetailer;
 
-
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -48,7 +64,7 @@
       // streams
       Thread.sleep(5000);
       long adaptorId = agent
-          .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped"
+          .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped"
               + " BigRecord " + logFile + " 0");
       assertTrue(adaptorId != -1);
 
@@ -64,7 +80,7 @@
           record8Found = true;
         }
       }
-      agent.getAdaptorList().get(adaptorId).shutdown();
+      agent.getAdaptor(adaptorId).shutdown();
       agent.shutdown();
     } catch (Exception e) {
       Assert.fail("Exception in testBigRecord" + e.getMessage());

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=783215&r1=783214&r2=783215&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
Wed Jun 10 06:01:26 2009
@@ -49,7 +49,7 @@
     Thread.sleep(5000);
     File testFile = makeTestFile("chukwaCrSepTest", 80);
     long adaptorId = agent
-        .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
+        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
             + " lines " + testFile + " 0");
     assertTrue(adaptorId != -1);
     System.out.println("getting a chunk...");

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=783215&r1=783214&r2=783215&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
Wed Jun 10 06:01:26 2009
@@ -49,7 +49,7 @@
     Thread.sleep(5000);
     File testFile = makeTestFile("chukwaLogRotateTest", 80);
     long adaptorId = agent
-        .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
+        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
             + " lines " + testFile + " 0");
     assertTrue(adaptorId != -1);
     System.out.println("getting a chunk...");

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java
Wed Jun 10 06:01:26 2009
@@ -50,7 +50,7 @@
     Thread.sleep(5000);
     File testFile = makeTestFile("chukwaRawTest", 80);
     long adaptorId = agent
-        .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor"
+        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor"
             + " raw " + testFile + " 0");
     assertTrue(adaptorId != -1);
     Chunk c = chunks.waitForAChunk();

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java
Wed Jun 10 06:01:26 2009
@@ -52,7 +52,7 @@
     File testFile = makeTestFile();
     int startOffset = 0; // skip first line
     long adaptorId = agent
-        .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8
"
+        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8
"
             + "lines " + startOffset + " " + testFile + " " + startOffset);
     assertTrue(adaptorId != -1);
     System.out.println("getting a chunk...");
@@ -90,7 +90,7 @@
     File testFile = makeTestFile();
     int startOffset = 0;
     long adaptorId = agent
-        .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8
"
+        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8
"
             + "lines "
             + startOffset
             + " "

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgent.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgent.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgent.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestAgent.java
Wed Jun 10 06:01:26 2009
@@ -66,7 +66,7 @@
 
         for (int i = 1; i < 7; ++i) {
           long l = agent
-              .processCommand("add  org.apache.hadoop.chukwa.util.ConstRateAdaptor  raw"
+              .processAddCommand("add  org.apache.hadoop.chukwa.util.ConstRateAdaptor  raw"
                   + i + " 2000" + i + " 0");
           assertTrue(l != -1);
           runningAdaptors.add(l);

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=783215&r1=783214&r2=783215&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
Wed Jun 10 06:01:26 2009
@@ -45,8 +45,8 @@
       conn.start();
       assertEquals(1, agent.adaptorCount());// check that we processed initial
                                             // adaptors
-      assertNotNull(agent.getAdaptorList().get(1L));
-      assertTrue(agent.getAdaptorList().get(1L).getStreamName().contains("foo"));
+      assertNotNull(agent.getAdaptor(1L));
+      assertTrue(agent.getAdaptor(1L).getStreamName().contains("foo"));
 
       System.out
           .println("---------------------done with first run, now stopping");
@@ -69,8 +69,8 @@
       conn.start();
       assertEquals(1, agent.adaptorCount());// check that we processed initial
                                             // adaptors
-      assertNotNull(agent.getAdaptorList().get(1L));
-      assertTrue(agent.getAdaptorList().get(1L).getStreamName().contains("foo"));
+      assertNotNull(agent.getAdaptor(1L));
+      assertTrue(agent.getAdaptor(1L).getStreamName().contains("foo"));
       agent.shutdown();
       System.out.println("---------------------done");
 
@@ -117,7 +117,7 @@
       agent = new ChukwaAgent(conf);
       assertEquals(0, agent.getAdaptorList().size());
       agent
-          .processCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor
testdata  0");
+          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor
testdata  0");
       agent.shutdown();
       assertTrue(new File(NONCE_DIR, "chukwa_checkpoint_1").exists());
 

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestCmd.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestCmd.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestCmd.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/agent/TestCmd.java
Wed Jun 10 06:01:26 2009
@@ -34,9 +34,9 @@
       ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
       conn.start();
       long l = agent
-          .processCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor
 chukwaTestAdaptorType 0 my param1 param2 /var/log/messages 114027");
+          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor
 chukwaTestAdaptorType 0 my param1 param2 /var/log/messages 114027");
       assertTrue(l != -1);
-      Adaptor adaptor = agent.getAdaptorList().get(l);
+      Adaptor adaptor = agent.getAdaptor(l);
       ChukwaTestAdaptor chukwaTestAdaptor = (ChukwaTestAdaptor) adaptor;
       assertTrue("error in type",
           "chukwaTestAdaptorType".intern() == chukwaTestAdaptor.getType()
@@ -64,9 +64,9 @@
       ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
       conn.start();
       long l = agent
-          .processCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor
 chukwaTestAdaptorType 114027");
+          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor
 chukwaTestAdaptorType 114027");
       assertTrue(l != -1);
-      Adaptor adaptor = agent.getAdaptorList().get(l);
+      Adaptor adaptor = agent.getAdaptor(l);
       ChukwaTestAdaptor chukwaTestAdaptor = (ChukwaTestAdaptor) adaptor;
       assertTrue("error in type",
           "chukwaTestAdaptorType".intern() == chukwaTestAdaptor.getType()
@@ -93,10 +93,10 @@
       ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
       conn.start();
       long l = agent
-          .processCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor"
+          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor"
               + "  chukwaTestAdaptorType 0  114027");
       assertTrue(l != -1);
-      Adaptor adaptor = agent.getAdaptorList().get(l);
+      Adaptor adaptor = agent.getAdaptor(l);
       ChukwaTestAdaptor chukwaTestAdaptor = (ChukwaTestAdaptor) adaptor;
       assertTrue("error in type",
           "chukwaTestAdaptorType".intern() == chukwaTestAdaptor.getType()

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/validationframework/ChukwaAgentToCollectorValidator.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/validationframework/ChukwaAgentToCollectorValidator.java?rev=783215&r1=783214&r2=783215&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/validationframework/ChukwaAgentToCollectorValidator.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/validationframework/ChukwaAgentToCollectorValidator.java
Wed Jun 10 06:01:26 2009
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.hadoop.chukwa.validationframework;
 
 



Mime
View raw message