Examples of processAddCommand()


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

    conf.set("chukwaAgent.control.port", "0");
    conf.setBoolean("chukwaAgent.checkpoint.enabled", false);
    ChukwaAgent agent = new ChukwaAgent(conf);
    ChunkCatcherConnector chunks = new ChunkCatcherConnector();
    chunks.start();
    String psAgentID = agent.processAddCommand(
        "add org.apache.hadoop.chukwa.datacollection.adaptor.ExecAdaptor ps ps aux 0");
    assertNotNull(psAgentID);
    Chunk c = chunks.waitForAChunk();
    System.out.println(new String(c.getData()));
    agent.shutdown();
View Full Code Here

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

    ChukwaAgent agent = new ChukwaAgent(conf);

    chunks = new ConsoleOutConnector(agent, false);
    chunks.start();
    assertEquals(0, agent.adaptorCount());
    String lsID = agent.processAddCommand(
      "add exec= org.apache.hadoop.chukwa.datacollection.adaptor.ExecAdaptor Listing 100 /bin/sleep 1 0");
    Thread.sleep( 5*1000); //RAISE THIS to test longer
    System.out.println("stopped ok");
  }

View Full Code Here

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

    root.addServlet(new ServletHolder(new ServletCollector(conf)), "/*");
    server.start();
    server.setStopAtShutdown(false);
    Thread.sleep(1000);
    agent.processAddCommand("add constSend = " + ConstRateAdaptor.class.getCanonicalName() +
        " testData "+ SEND_RATE + " 0");
    assertNotNull(agent.getAdaptor("constSend"));
    Thread.sleep(TEST_DURATION_SECS * 1000);

    String[] stat = agent.getAdaptorList().get("constSend").split(" ");
View Full Code Here

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

   
    Configuration conf = new Configuration();
    conf.set("chukwaAgent.control.port", "0");
    ChukwaAgent agent = new ChukwaAgent(conf);
    File testFile = makeTestFile("chukwaTest", 80);
    String adaptorId = agent
        .processAddCommand("add test = org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
            + " lines " + testFile + " 0");
    assertTrue(adaptorId.equals("test"));
    System.out.println("getting a chunk...");
    Chunk c = chunks.waitForAChunk();
View Full Code Here

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

    File testFile = TestRawAdaptor.makeTestFile("testDA", 50);
    long len = testFile.length();
    System.out.println("wrote data to " + testFile);
    AdaptorResetThread restart = new AdaptorResetThread(conf, agent);
    //start timeout thread
    agent.processAddCommand("add fta = "+ FileTailingAdaptor.class.getCanonicalName()
        + " testdata " + testFile.getCanonicalPath() + " 0" );
   
   
    assertEquals(1, agent.adaptorCount());
    Chunk c1 = chunks.waitForAChunk();
View Full Code Here

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

      Thread.sleep(1000);
     
      ChukwaAgent agent = new ChukwaAgent(conf);
      HttpConnector conn = new HttpConnector(agent, "http://localhost:"+PORTNO+"/");
      conn.start();
      String resp = agent.processAddCommand("add constSend = " + ConstRateAdaptor.class.getCanonicalName() +
          " testData "+ SEND_RATE + " 0");
      assertTrue("constSend".equals(resp));
      Thread.sleep(END2END_TEST_SECS * 1000);

      //do the shutdown directly, here, so that acks are still processed.
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("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()

    // 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 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);
    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
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.