Package org.apache.hadoop.chukwa.conf

Examples of org.apache.hadoop.chukwa.conf.ChukwaConfiguration


    }
   
    for(int i=1; i < args.length; ++i)
        System.err.println("FileGlob: " + args[i]);

    ChukwaConfiguration conf = new ChukwaConfiguration();


    dump(args, conf, System.out);
  }
View Full Code Here


  protected ChukwaConfiguration conf = null;
  protected FileSystem fs = null;
  protected boolean isRunning = true;
 
  public ChukwaArchiveManager() throws Exception {
    conf = new ChukwaConfiguration();
    init();
  }
View Full Code Here

    conf = new ChukwaConfiguration();
    init();
  }

  public ChukwaArchiveManager(ChukwaConfiguration conf) throws Exception {
    conf = new ChukwaConfiguration();
    init();
  }
View Full Code Here

    manager.start();

  }

  public DemuxManager() throws Exception {
    this.conf = new ChukwaConfiguration();
    init();
  }
View Full Code Here

    }    
  };

 
  public PostProcessorManager() throws Exception {
    this.conf = new ChukwaConfiguration();
    init();
  }
View Full Code Here

                    + "\n\tservlet=<classname>@path");
        System.out.println("Command line options will override normal configuration.");
        System.exit(0);
      }

      ChukwaConfiguration conf = new ChukwaConfiguration();
      int portNum = conf.getInt("chukwaCollector.http.port", 9999);
      THREADS = conf.getInt("chukwaCollector.http.threads", THREADS);

      // pick a writer.
      ChukwaWriter w = null;
      Map<String, HttpServlet> servletsToAdd = new TreeMap<String, HttpServlet>();
      ServletCollector servletCollector = new ServletCollector(conf);
      for(String arg: args) {
        if(arg.startsWith("writer=")) {       //custom writer class
          String writerCmd = arg.substring("writer=".length());
          if (writerCmd.equals("pretend") || writerCmd.equals("pretend-quietly")) {
            boolean verbose = !writerCmd.equals("pretend-quietly");
            w = new ConsoleWriter(verbose);
            w.init(conf);
            servletCollector.setWriter(w);
          } else
            conf.set("chukwaCollector.writerClass", writerCmd);
        } else if(arg.startsWith("servlet=")) {     //adding custom servlet
           String servletCmd = arg.substring("servlet=".length());
           String[] halves = servletCmd.split("@");
           try {
             Class<?> servletClass = Class.forName(halves[0]);
             HttpServlet srvlet = (HttpServlet) servletClass.newInstance();
             if(!halves[1].startsWith("/"))
               halves[1] = "/" + halves[1];
             servletsToAdd.put(halves[1], srvlet);
           } catch(Exception e) {
             e.printStackTrace();
           }
        } else if(arg.startsWith("portno=")) {
          portNum = Integer.parseInt(arg.substring("portno=".length()));
        } else { //unknown arg
          System.out.println("WARNING: unknown command line arg " + arg);
          System.out.println("Invoke collector with command line arg 'help' for usage");
        }
      }

      // Set up jetty connector
      SelectChannelConnector jettyConnector = new SelectChannelConnector();
      jettyConnector.setLowResourcesConnections(THREADS - 10);
      jettyConnector.setLowResourceMaxIdleTime(1500);
      jettyConnector.setPort(portNum);
     
      // Set up jetty server proper, using connector
      jettyServer = new Server(portNum);
      jettyServer.setConnectors(new Connector[] { jettyConnector });
      org.mortbay.thread.BoundedThreadPool pool = new org.mortbay.thread.BoundedThreadPool();
      pool.setMaxThreads(THREADS);
      jettyServer.setThreadPool(pool);
     
      // Add the collector servlet to server
      Context root = new Context(jettyServer, "/", Context.SESSIONS);
      root.addServlet(new ServletHolder(servletCollector), "/*");
     
      if(conf.getBoolean(HttpConnector.ASYNC_ACKS_OPT, false))
        root.addServlet(new ServletHolder(new CommitCheckServlet(conf)), "/"+CommitCheckServlet.DEFAULT_PATH);

      root.setAllowNullPathInfo(false);

      // Add in any user-specified servlets
View Full Code Here

    String machine = args[1];
    String adaptorName = args[2];
    String recordType = args[3];
    String logFile = args[4];

    BackfillingLoader loader = new BackfillingLoader(new ChukwaConfiguration(),cluster,machine,adaptorName,recordType,logFile);
    loader.process();
  }
View Full Code Here

      InMemoryWriter readInData =  new InMemoryWriter();
      ServletCollector.setWriter(readInData);
 
      Thread.sleep(1000);
       
      ChukwaConfiguration cc = new ChukwaConfiguration();
      int portno = cc.getInt("chukwaAgent.control.port", 9093);
      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);
     
      File tmpOutput = new File("/tmp/chukwaTest");
      FileOutputStream fos = new FileOutputStream(tmpOutput);
      Random r = new Random();
View Full Code Here

      ConsoleWriter readInData =  new ConsoleWriter(false);
      ServletCollector.setWriter(readInData);
 
      Thread.sleep(1000);
      
      ChukwaConfiguration cc = new ChukwaConfiguration();
      int portno = cc.getInt("chukwaAgent.control.port", 9093);
      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);
     
      for(int i=1; i < STOPS_AND_STARTS; ++i) {
        cli.add("org.apache.hadoop.chukwa.util.ConstRateAdaptor", "oneatatime_raw" + i, "20000", 0);
        assertEquals("adaptor failed to start", 1, agent.adaptorCount());
View Full Code Here

      ServletCollector.setWriter(readInData);
 
      Thread.sleep(1000);

     
      ChukwaConfiguration cc = new ChukwaConfiguration();
      int portno = cc.getInt("chukwaAgent.control.port", 9093);
      ChukwaAgentController cli = new ChukwaAgentController("localhost", portno);
      assertEquals("no adaptors should be running pre-test",0, agent.adaptorCount());
      for(int i=0; i < 10; ++i) {
       
        for(int n = 1; n < 7; ++n) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.chukwa.conf.ChukwaConfiguration

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.