Package org.apache.hadoop.chukwa.datacollection.agent

Examples of org.apache.hadoop.chukwa.datacollection.agent.ChukwaAgent.processCommand()


     
      for(int trial=0; trial < 20; ++trial) {
        ArrayList<Long> runningAdaptors = new ArrayList<Long>();
      
        for(int i = 1; i < 7; ++i) {
          long l = agent.processCommand("add org.apache.hadoop.chukwa.util.ConstRateAdaptor raw"+i+ " 20000 0");
          assertTrue(agent.adaptorCount() == i);
          assertTrue(l != -1);
          runningAdaptors.add(l);
        }
        Thread.sleep(1000);  
View Full Code Here


  }
 
  public void testWithPs() throws ChukwaAgent.AlreadyRunningException {
    try {
      ChukwaAgent  agent = new ChukwaAgent();
      agent.processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.ExecAdaptor ps ps aux 0");
 
      Chunk c = chunks.waitForAChunk();
      System.out.println(new String(c.getData()));
    } catch(InterruptedException e) {
     
View Full Code Here

 
  public void testRawAdaptor() throws IOException, InterruptedException, ChukwaAgent.AlreadyRunningException {
    ChukwaAgent  agent = new ChukwaAgent();
   
    File testFile = makeTestFile("/tmp/chukwaTest");
    agent.processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor" +
        " raw " + testFile + " 0");
    assertTrue(agent.adaptorCount() == 1);
    Chunk c = chunks.waitForAChunk();
    assertTrue(c.getDataType().equals("raw"));
    assertTrue(c.getRecordOffsets().length == 1);
View Full Code Here


  public void testCrSepAdaptor() throws IOException, InterruptedException, ChukwaAgent.AlreadyRunningException {
    ChukwaAgent  agent = new ChukwaAgent();
    File testFile = makeTestFile("/tmp/chukwaTest");
    agent.processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8" +
        " lines " + testFile + " 0");
    assertTrue(agent.adaptorCount() == 1);
    System.out.println("getting a chunk...");
    Chunk c = chunks.waitForAChunk();
    System.out.println("got chunk");
View Full Code Here

 
  public void testStartAtOffset() throws IOException, InterruptedException, ChukwaAgent.AlreadyRunningException {
    ChukwaAgent  agent = new ChukwaAgent();
    File testFile = makeTestFile();
    int startOffset = 50;
    agent.processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8 " +
         "lines "+ startOffset+ " " + testFile + " " + startOffset);
    assertTrue(agent.adaptorCount() == 1);
    System.out.println("getting a chunk...");
    Chunk c = chunks.waitForAChunk();
    System.out.println("got chunk");
View Full Code Here

 
  public void testStartAfterOffset() throws IOException, InterruptedException, ChukwaAgent.AlreadyRunningException {
    ChukwaAgent  agent = new ChukwaAgent();
    File testFile = makeTestFile();
    int startOffset = 50;
    agent.processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8 " +
         "lines "+ startOffset+ " " + testFile + " " + (startOffset + 29) );
    assertTrue(agent.adaptorCount() == 1);
    System.out.println("getting a chunk...");
    Chunk c = chunks.waitForAChunk();
    System.out.println("got chunk");
View Full Code Here

      int count = agent.adaptorCount();
      for (int trial = 0; trial < 20; ++trial) {
        ArrayList<Long> runningAdaptors = new ArrayList<Long>();

        for (int i = 1; i < 7; ++i) {
          long l = agent
              .processCommand("add  org.apache.hadoop.chukwa.util.ConstRateAdaptor  raw"
                  + i + " 2000" + i + " 0");
          assertTrue(l != -1);
          runningAdaptors.add(l);
        }
View Full Code Here

  }

  public void testWithPs() throws ChukwaAgent.AlreadyRunningException {
    try {
      ChukwaAgent agent = new ChukwaAgent();
      agent
          .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.ExecAdaptor ps ps aux 0");

      Chunk c = chunks.waitForAChunk();
      System.out.println(new String(c.getData()));
    } catch (InterruptedException e) {
View Full Code Here

      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);
      cli.removeAll();
      // sleep for some time to make sure we don't get chunk from existing
      // streams
      Thread.sleep(5000);
      long adaptorId = agent
          .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped"
              + " BigRecord " + logFile + " 0");
      assertTrue(adaptorId != -1);

      boolean record8Found = false;
View Full Code Here

    cli.removeAll();
    // sleep for some time to make sure we don't get chunk from existing streams
    Thread.sleep(5000);
    File testFile = makeTestFile();
    int startOffset = 0; // skip first line
    long adaptorId = agent
        .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8 "
            + "lines " + startOffset + " " + testFile + " " + startOffset);
    assertTrue(adaptorId != -1);
    System.out.println("getting a chunk...");
    Chunk c = chunks.waitForAChunk();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.