Examples of ChukwaAgentController


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("chukwaLogRotateTest", 80);
    String adaptorId = agent
        .processAddCommand("add lr =org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
View Full Code Here

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

      Configuration conf = new ChukwaConfiguration();
      conf.set("chukwaAgent.control.port", "0");
      agent = new ChukwaAgent(conf);
      // Remove any adaptor left over from previous run

      ChukwaAgentController cli = new ChukwaAgentController("localhost", agent.getControllerPort());
      cli.removeAll();
      // sleep for some time to make sure we don't get chunk from existing
      // streams
      Thread.sleep(5000);

      assertTrue(testFile.canRead() == true);
View Full Code Here

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

        Thread.sleep(1000);
        portno = agent.getControllerPort();
      }

      // System.out.println("Port number:" + portno);
      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"
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");
    String 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 Configuration();
    agent = new ChukwaAgent(config);
    c = new ChukwaAgentController();
    connector = new ChunkCatcherConnector();
    connector.start();
  }
View Full Code Here

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

   */
  protected void initialTasks () {
    System.out.println("In initialTasks()");
    try {
      // Test Chukwa Agent Controller and Agent Communication
      ChukwaAgentController cli = new ChukwaAgentController("localhost", agentPort);
      String[] source = new File(System.getenv("CHUKWA_DATA_DIR") + File.separator + "log").list(new FilenameFilter() {
        public boolean accept(File dir, String name) {
          return name.endsWith(".log");
        }
      });
      System.out.println(System.getenv("CHUKWA_DATA_DIR") + File.separator + "log");
      for(String fname : source) {
        if (!(fname.equals("JobHistory.log") || fname.equals("ClientTrace.log"))) {
          continue;
        }
        StringBuilder fullPath = new StringBuilder();
        fullPath.append(System.getProperty("CHUKWA_DATA_DIR"));
        fullPath.append(File.separator);
        fullPath.append("log");
        fullPath.append(File.separator);       
        fullPath.append(fname);
        String recordType = fname.substring(0,fname.indexOf("."));
        String adaptorId = cli.add(
          "org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped",
          recordType, "0 " + fullPath.toString(), 0);
        assertNotNull(adaptorId);
        Thread.sleep(2000);
      }
      cli.removeAll();
      Thread.sleep(30000);
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.toString());
    }
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

          "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

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

      int portno = agent.getControllerPort();
      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);

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

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

          }

          if (chukwaClient == null) {
            if (getChukwaClientHostname() != null
                && getChukwaClientPortNum() != 0) {
              chukwaClient = new ChukwaAgentController(
                  getChukwaClientHostname(), getChukwaClientPortNum());
              log.debug("setup adaptor with hostname "
                  + getChukwaClientHostname() + " and portnum "
                  + getChukwaClientPortNum());
            } else {
              chukwaClient = new ChukwaAgentController();
              log
              .debug("setup adaptor with no args, which means it used its defaults");
            }

            chukwaClientIsNull = false;
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.