Package org.apache.hadoop.chukwa.datacollection.test

Examples of org.apache.hadoop.chukwa.datacollection.test.ConsoleOutConnector


      }

      int uriArgNumber = 0;
      if (args.length > 0) {
        if (args[uriArgNumber].equals("local"))
          agent.connector = new ConsoleOutConnector(agent);
        else {
          if (!args[uriArgNumber].contains("://"))
            args[uriArgNumber] = "http://" + args[uriArgNumber];
          agent.connector = new HttpConnector(agent, args[uriArgNumber]);
        }
View Full Code Here


    ChukwaAgent agent;
    try {
      Configuration conf = new Configuration();
      conf.set("chukwaAgent.control.port", "0");
      agent = new ChukwaAgent(conf);
      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();
      String l = agent
          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor  chukwaTestAdaptorType 0 my param1 param2 /var/log/messages 114027");
      assertTrue(l != null);
      Adaptor adaptor = agent.getAdaptor(l);
      ChukwaTestAdaptor chukwaTestAdaptor = (ChukwaTestAdaptor) adaptor;
View Full Code Here

    ChukwaAgent agent;
    try {
      Configuration conf = new Configuration();
      conf.set("chukwaAgent.control.port", "0");
      agent = new ChukwaAgent(conf);
      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();
      String name = agent
          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor  chukwaTestAdaptorType 114027");
      assertTrue(name != null);
      Adaptor adaptor = agent.getAdaptor(name);
      ChukwaTestAdaptor chukwaTestAdaptor = (ChukwaTestAdaptor) adaptor;
View Full Code Here

    ChukwaAgent agent;
    try {
      Configuration conf = new Configuration();
      conf.set("chukwaAgent.control.port", "0");
      agent = new ChukwaAgent(conf);
      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();
      String n = agent
          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor"
              + "  chukwaTestAdaptorType 0  114027");
      assertTrue(n != null);
      Adaptor adaptor = agent.getAdaptor(n);
View Full Code Here

    try {
      Configuration conf = new Configuration();
      conf.setInt("chukwaAgent.control.port", 0);
      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) {
      e.printStackTrace();
      fail(e.toString());
    }
View Full Code Here

    try {
      Configuration conf = new Configuration();
      conf.setInt("chukwaAgent.control.port", 0);
      ChukwaAgent agent = new ChukwaAgent(conf);
      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();
      int count = agent.adaptorCount();
      for (int trial = 0; trial < 20; ++trial) {
        ArrayList<String> runningAdaptors = new ArrayList<String>();

        for (int i = 1; i < 7; ++i) {
View Full Code Here

      checkpointDir.mkdir();
      checkpointDir.deleteOnExit();
      conf.set("chukwaAgent.checkpoint.dir", checkpointDir.getAbsolutePath());

      ChukwaAgent agent = new ChukwaAgent(conf);
      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();
      assertEquals(1, agent.adaptorCount());// check that we processed initial
                                            // adaptors
      assertNotNull(agent.getAdaptor("adaptor_testAdaptor"));
      assertTrue(agent.getAdaptor("adaptor_testAdaptor").getCurrentStatus().contains("foo"));

      System.out
          .println("---------------------done with first run, now stopping");
      agent.shutdown();
      Thread.sleep(2000);
      assertEquals(0, agent.adaptorCount());
      // at this point, there should be a checkpoint file with a tailer reading
      // foo.
      // we're going to rewrite initial adaptors to read bar; after reboot
      // we should  be looking at both foo andn bar.
      ps = new PrintStream(new FileOutputStream(initialAdaptors, false));// overwrite
      ps.println("add bar= org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8  raw 0 "
              + bar.getAbsolutePath() + " 0  ");
      ps.close();

      System.out.println("---------------------restarting");
      agent = new ChukwaAgent(conf);
      conn = new ConsoleOutConnector(agent, true);
      conn.start();
      assertEquals(2, agent.adaptorCount());// check that we processed initial
                                            // adaptors
      assertNotNull(agent.getAdaptor("adaptor_testAdaptor"));
      assertTrue(agent.getAdaptor("adaptor_testAdaptor").getCurrentStatus().contains("foo"));
      agent.shutdown();
View Full Code Here

    ChukwaAgent agent;
    try {
      Configuration conf = new Configuration();
      conf.set("chukwaAgent.control.port", "0");
      agent = new ChukwaAgent(conf);
      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();
      String l = agent
          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor  chukwaTestAdaptorType 0 my param1 param2 /var/log/messages 114027");
      assertTrue(l != null);
      Adaptor adaptor = agent.getAdaptor(l);
      ChukwaTestAdaptor chukwaTestAdaptor = (ChukwaTestAdaptor) adaptor;
View Full Code Here

    ChukwaAgent agent;
    try {
      Configuration conf = new Configuration();
      conf.set("chukwaAgent.control.port", "0");
      agent = new ChukwaAgent(conf);
      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();
      String name = agent
          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor  chukwaTestAdaptorType 114027");
      assertTrue(name != null);
      Adaptor adaptor = agent.getAdaptor(name);
      ChukwaTestAdaptor chukwaTestAdaptor = (ChukwaTestAdaptor) adaptor;
View Full Code Here

    ChukwaAgent agent;
    try {
      Configuration conf = new Configuration();
      conf.set("chukwaAgent.control.port", "0");
      agent = new ChukwaAgent(conf);
      ConsoleOutConnector conn = new ConsoleOutConnector(agent, true);
      conn.start();
      String n = agent
          .processAddCommand("ADD org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor"
              + "  chukwaTestAdaptorType 0  114027");
      assertTrue(n != null);
      Adaptor adaptor = agent.getAdaptor(n);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.chukwa.datacollection.test.ConsoleOutConnector

Copyright © 2018 www.massapicom. 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.