Package org.apache.hadoop.chukwa.datacollection.sender

Examples of org.apache.hadoop.chukwa.datacollection.sender.RetryListOfCollectors


    hosts.add("host1");
    hosts.add("host2");
    hosts.add("host3");
    hosts.add("host4");
    Configuration conf = new Configuration();
    RetryListOfCollectors rloc = new RetryListOfCollectors(hosts, conf);
    rloc.shuffleList();
    assertEquals(hosts.size(), rloc.total());

    for (int i = 0; i < hosts.size(); ++i) {
      assertTrue(rloc.hasNext());
      String s = rloc.next();
      assertTrue(s != null);
      System.out.println(s);
    }

    if (rloc.hasNext()) {
      String s = rloc.next();
      System.out.println("saw unexpected collector " + s);
      fail();
    }
  }
View Full Code Here


    out.println("host6:5052");
    out.close();
   
    Configuration conf = new Configuration();
    conf.setInt("chukwaCollector.http.port", 5052);
    RetryListOfCollectors rloc = new RetryListOfCollectors(tmpOutput, conf);
    for (int i = 0; i < validHosts.size(); ++i) {
      assertTrue(rloc.hasNext());
      String s = rloc.next();
      assertTrue(s != null);
     
      System.out.println("host: " + s);
      assertTrue(validHosts.contains(s));
    }
   
    if (rloc.hasNext()) {
      String s = rloc.next();
      System.out.println("saw unexpected collector " + s);
      fail();
    }

    } catch(IOException e) {
View Full Code Here

    log.info("setting up collectors file: " + chukwaConf + File.separator
        + COLLECTORS_FILENAME);
    File collectors = new File(chukwaConf + File.separator + filename);
    try {
      return new RetryListOfCollectors(collectors, conf);
    } catch (java.io.IOException e) {
      log.error("failed to read collectors file: ", e);
      throw e;
    }
  }
View Full Code Here

    Server collector2_s = TestDelayedAcks.startCollectorOnPort(conf, PORTNO+2, collector2);
    Thread.sleep(2000); //for collectors to start
   
    ChukwaAgent agent = new ChukwaAgent(conf);
    HttpConnector conn = new HttpConnector(agent);
    RetryListOfCollectors clist = new RetryListOfCollectors(conf);
    clist.add("http://localhost:"+(PORTNO+1)+"/");
    clist.add("http://localhost:"+(PORTNO+2)+"/");
    conn.setCollectors(clist);
    conn.start();
    //FIXME: somehow need to clue in commit checker which paths to check.
    //       Somehow need
View Full Code Here

      conn = new HttpConnector(agent, "http://localhost:"+collectorPort+"/chukwa");
      conn.start();     
      sender = new ChukwaHttpSender(conf);
      ArrayList<String> collectorList = new ArrayList<String>();
      collectorList.add("http://localhost:"+collectorPort+"/chukwa");
      sender.setCollectors(new RetryListOfCollectors(collectorList, conf));
    } catch (AlreadyRunningException e) {
      fail("Chukwa Agent is already running");
    }
    System.out.println("Done setUp().");
  }
View Full Code Here

    conf.setInt("constAdaptor.sleepVariance", 1);
    conf.setInt("constAdaptor.minSleep", 50);
   
    conf.setInt("chukwaAgent.control.port", 0);
    ChukwaAgent agent = new ChukwaAgent(conf);
    RetryListOfCollectors clist = new RetryListOfCollectors(conf);
    clist.add("http://localhost:"+PORTNO+"/chukwa");
    HttpConnector conn = new HttpConnector(agent);
    conn.setCollectors(clist);
    conn.start();
    Server server = new Server(PORTNO);
    Context root = new Context(server, "/", Context.SESSIONS);
View Full Code Here

    Server collector2_s = TestDelayedAcks.startCollectorOnPort(conf, PORTNO+2, collector2);
    Thread.sleep(2000); //for collectors to start
   
    ChukwaAgent agent = new ChukwaAgent(conf);
    HttpConnector conn = new HttpConnector(agent);
    RetryListOfCollectors clist = new RetryListOfCollectors(conf);
    clist.add("http://localhost:"+(PORTNO+1)+"/");
    clist.add("http://localhost:"+(PORTNO+2)+"/");
    conn.setCollectors(clist);
    conn.start();
    //FIXME: somehow need to clue in commit checker which paths to check.
    //       Somehow need
View Full Code Here

    conf.setInt("constAdaptor.sleepVariance", 1);
    conf.setInt("constAdaptor.minSleep", 50);
   
    conf.setInt("chukwaAgent.control.port", 0);
    ChukwaAgent agent = new ChukwaAgent(conf);
    RetryListOfCollectors clist = new RetryListOfCollectors(conf);
    clist.add("http://localhost:"+PORTNO+"/chukwa");
    HttpConnector conn = new HttpConnector(agent);
    conn.setCollectors(clist);
    conn.start();
    Server server = new Server(PORTNO);
    Context root = new Context(server, "/", Context.SESSIONS);
View Full Code Here

    List<String> hosts = new ArrayList<String>();
    hosts.add("host1");
    hosts.add("host2");
    hosts.add("host3");
    hosts.add("host4");
    RetryListOfCollectors rloc = new RetryListOfCollectors(hosts, 2000);
    assertEquals(hosts.size(), rloc.total());
   
    for(int i = 0; i < hosts.size(); ++i) {
      assertTrue(rloc.hasNext());
      String s =  rloc.next();
      assertTrue(s != null);
      System.out.println(s);
    }
   
    if(rloc.hasNext()) {
      String s = rloc.next();
      System.out.println("saw unexpected collector " + s);
      fail();
    }
 
  }
View Full Code Here

      chukwaHome = ".";
    }
    log.info("setting up collectors file: " + chukwaHome + "/conf/collectors");
    File collectors = new File(chukwaHome + "/conf/collectors");
    try{
      return new RetryListOfCollectors(collectors, 1000 * 15);//time is ms between tries
    } catch(java.io.IOException e) {
      log.error("failed to read collectors file: ", e);
      throw e;
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.chukwa.datacollection.sender.RetryListOfCollectors

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.