Examples of ChukwaAgentController


Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

      HttpConnector connector = new HttpConnector(agent, "http://localhost:9990/chukwa");
      connector.start();
     
      ChukwaConfiguration cc = new ChukwaConfiguration();
      int portno = cc.getInt("chukwaAgent.control.port", 9093);
      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);
     

      File workdir = new File("/tmp/stresstest/");
      workdir.mkdir();
      for(int i = 0; i < FILES_TO_USE; ++i) {
        File newTestF = new File( "/tmp/stresstest/" + i);
       
        newTestF.deleteOnExit();
        (new OccasionalWriterThread(newTestF)).start();
        cli.addFile("test-lines", newTestF.getAbsolutePath());
      }

      Thread.sleep(60 * 1000);
      System.out.println("cleaning up");
      workdir.delete();
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

 
  public ChukwaTTInstru(TaskTracker t) {
    super(t)//PENDING
    stdOutAdaptors = new HashMap<TaskAttemptID, Long>();
    stdErrAdaptors = new HashMap<TaskAttemptID, Long>();
    chukwa = new ChukwaAgentController();
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

    //point which is called after all setters have been called with
    //their values from the log4j.properties file, in particular we
    //needed to give setCukwaClientPortNum() and -Hostname() a shot
    if (chukwaClient == null){
        if (getChukwaClientHostname() != null && getChukwaClientPortNum() != 0){
        chukwaClient = new ChukwaAgentController(getChukwaClientHostname(), getChukwaClientPortNum());
        System.out.println("setup adaptor with hostname " + getChukwaClientHostname() + " and portnum " + getChukwaClientPortNum());
      }
      else{
        chukwaClient = new ChukwaAgentController();
        System.out.println("setup adaptor with no args, which means it used its defaults");
      }
       
      //if they haven't specified, default to retrying every 10 seconds for 5 minutes
      long retryInterval = chukwaClientConnectRetryInterval;
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

          "http://localhost:9990/chukwa");
      connector.start();

      ChukwaConfiguration cc = new ChukwaConfiguration();
      int portno = cc.getInt("chukwaAgent.control.port", 9093);
      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);

      File workdir = new File("/tmp/stresstest/");
      workdir.mkdir();
      for (int i = 0; i < FILES_TO_USE; ++i) {
        File newTestF = new File("/tmp/stresstest/" + i);

        newTestF.deleteOnExit();
        (new OccasionalWriterThread(newTestF)).start();
        cli.addFile("test-lines", newTestF.getAbsolutePath());
      }

      Thread.sleep(60 * 1000);
      System.out.println("cleaning up");
      workdir.delete();
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

  public ChukwaJobTrackerInstrumentation(JobTracker jt, JobConf conf) {
    super(jt, conf);
    tracker = jt;
    if (chukwaClient == null) {
      chukwaClient = new ChukwaAgentController();
    }
    if (jobHistories == null) {
      jobHistories = new HashMap<JobID, Long>();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();

      ChukwaConfiguration cc = new ChukwaConfiguration();
      int portno = cc.getInt("chukwaAgent.control.port", 9093);
      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);

      for (int i = 1; i < 20; ++i) {
        long adaptorId = cli.add(
            "org.apache.hadoop.chukwa.util.ConstRateAdaptor", "raw" + i, "2000"
                + i, 0);
        assertTrue(adaptorId != -1);
        Thread.sleep(2000);
        cli.removeAll();
      }
      agent.shutdown();
      conn.shutdown();
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

    // Start the agent
    ChukwaAgent agent = ChukwaAgent.getAgent();

    int portno = 9093; // Default
    ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);
    // ADD
    // org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.
    // CharFileTailingAdaptorUTF8NewLineEscaped
    // SysLog
    // 0 /var/log/messages
    // 0
    System.out.println("Adding adaptor");
    long adaptor = cli
        .add(
            "org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped",
            "AutomatedTestType", "0 " + inputFile, 0);

    cli.remove(adaptor);
    System.out.println("Adaptor removed");
    agent.shutdown();
    System.out.println("Shutting down agent");
    CollectorStub.jettyServer.stop();
    System.out.println("Shutting down collector");
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

  // consoleConnector = new ConsoleOutConnector(agent);

  protected void setUp() throws ChukwaAgent.AlreadyRunningException {
    config = new ChukwaConfiguration();
    agent = new ChukwaAgent();
    c = new ChukwaAgentController();
    httpConnector = new HttpConnector(agent); // use default source for list of
                                              // collectors (i.e.
                                              // conf/connectors)

    httpConnector.start();
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

          "http://localhost:1234/chukwa");
      connector.start();

      ChukwaConfiguration cc = new ChukwaConfiguration();
      int portno = cc.getInt("chukwaAgent.control.port", 9093);
      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);

      File tmpOutput = TempFileUtil.makeBinary(2000);

      cli.addFile("unknown", tmpOutput.getAbsolutePath());
      System.out.println("have " + agent.adaptorCount() + " running adaptors");
      cli.removeFile("unknown", tmpOutput.getAbsolutePath());

      tmpOutput.delete();
      assertFalse(failed);
      System.out.println("done");
      agent.shutdown();
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.controller.ChukwaAgentController

      ChukwaAgent.AlreadyRunningException {
    ChukwaAgent agent = new ChukwaAgent();
    // Remove any adaptor left over from previous run
    ChukwaConfiguration cc = new ChukwaConfiguration();
    int portno = cc.getInt("chukwaAgent.control.port", 9093);
    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("chukwaCrSepTest", 80);
    long adaptorId = agent
        .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
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.