Examples of processAddCommand()


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

    ChukwaAgent agent = new ChukwaAgent(conf);

    File testFile = makeTestFile("chukwaRawTest", 80,
        new File(System.getProperty("test.build.data", "/tmp")));
   
    String adaptorId = agent
        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor."
            +"filetailer." + name
            + " raw " + testFile + " 0");
    assertNotNull(adaptorId);
    Chunk c = chunks.waitForAChunk(1000);
View Full Code Here

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

    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);
    File testFile = makeTestFile("chukwaLogRotateTest", 80);
    String adaptorId = agent
        .processAddCommand("add lr =org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
            + " lines " + testFile + " 0");
    assertTrue(adaptorId.equals("adaptor_lr"));
    System.out.println("getting a chunk...");
    Chunk c = chunks.waitForAChunk();
View Full Code Here

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

      conf.set("chukwaAgent.control.port", "0");
      agent = new ChukwaAgent(conf);

      FileTailingAdaptor.GRACEFUL_PERIOD = 30 * 1000;

      String adaptorId = agent
          .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped MyType 0 /myWrongPath"
              + System.currentTimeMillis() + " 0");

      assertTrue(adaptorId != null);

View Full Code Here

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

      Thread.sleep(5000);

      assertTrue(testFile.canRead() == true);

      FileTailingAdaptor.GRACEFUL_PERIOD = 30 * 1000;
      String adaptorId = agent
          .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped MyType 0 "
              + logFile + " 0");

      assertTrue(adaptorId != null);

View Full Code Here

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

    // Remove any adaptor left over from previous run

    // sleep for some time to make sure we don't get chunk from existing streams
    Thread.sleep(5000);
    assertEquals(0, agent.adaptorCount());
    String adaptorId = agent
        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
            + " lines " + testFile + " 0");
    assertNotNull(adaptorId);
    assertEquals(1, agent.adaptorCount());
View Full Code Here

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

    for(int i=0; i < tests; ++i) {
      if(i % 100 == 0)
        System.out.println("buzzed " + i + " times");
     
      assertEquals(0, agent.adaptorCount());
      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());
      assertTrue(dat.startsWith("0 abcdefghijklmnopqrstuvwxyz"));
      assertTrue(dat.endsWith("9 abcdefghijklmnopqrstuvwxyz\n"));
View Full Code Here

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

  public void testOffsetInAdaptorName() throws IOException, ChukwaAgent.AlreadyRunningException,
  InterruptedException{
    File testFile = makeTestFile("foo", 120,baseDir);
    ChukwaAgent agent = new ChukwaAgent(conf);
    assertEquals(0, agent.adaptorCount());
    agent.processAddCommand("add test = filetailer.FileTailingAdaptor raw " +testFile.getCanonicalPath() + " 0");
    assertEquals(1, agent.adaptorCount());
    Thread.sleep(2000);
    agent.processAddCommand("add test = filetailer.FileTailingAdaptor raw " +testFile.getCanonicalPath() + " 0");
    assertEquals(1, agent.adaptorCount());
    chunks.clear();
View Full Code Here

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

    ChukwaAgent agent = new ChukwaAgent(conf);
    assertEquals(0, agent.adaptorCount());
    agent.processAddCommand("add test = filetailer.FileTailingAdaptor raw " +testFile.getCanonicalPath() + " 0");
    assertEquals(1, agent.adaptorCount());
    Thread.sleep(2000);
    agent.processAddCommand("add test = filetailer.FileTailingAdaptor raw " +testFile.getCanonicalPath() + " 0");
    assertEquals(1, agent.adaptorCount());
    chunks.clear();
    agent.shutdown();
  }
View Full Code Here

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

      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);
      String adaptorId = agent
          .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped"
              + " BigRecord " + logFile + " 0");
      assertNotNull(adaptorId);

      boolean record8Found = false;
View Full Code Here

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

    conf.set("chukwaAgent.control.port", "0");
    conf.setInt("chukwaAgent.adaptor.context.switch.time", 100);
    ChukwaAgent agent = new ChukwaAgent(conf);
    File testFile = makeTestFile();
    int startOffset = 0; // skip first line
    String adaptorId = agent
       .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor"+
            "filetailer.CharFileTailingAdaptorUTF8 "
            + "lines " + startOffset + " " + testFile + " " + startOffset);
    assertTrue(adaptorId != null);
    System.out.println("getting a chunk...");
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.