Package org.apache.hadoop.chukwa.conf

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


    try {
      ChukwaAgent agent = new ChukwaAgent();
      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) {
        cli.add("org.apache.hadoop.chukwa.util.ConstRateAdaptor", "raw" + i, "20000", 0);
        assertTrue(agent.adaptorCount() == 1);
View Full Code Here


  public static void main(String[] args) throws IOException,
      URISyntaxException
  {
    System.out.println("Input directory:" + args[0]);

    ChukwaConfiguration conf = new ChukwaConfiguration();
    String fsName = conf.get("writer.hdfs.filesystem");
    FileSystem fs = FileSystem.get(new URI(fsName), conf);

    Path srcDir = new Path(args[0]);
    FileStatus fstat = fs.getFileStatus(srcDir);
View Full Code Here

   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception
  {
    ChukwaConfiguration conf = new ChukwaConfiguration();
    String fsName = conf.get("writer.hdfs.filesystem");
    FileSystem fs = FileSystem.get(new URI(fsName), conf);
    Path srcDir = new Path(args[0]);
    String destDir = args[1];
   
    FileStatus fstat = fs.getFileStatus(srcDir);
   
    if (!fstat.isDir())
    {
      throw new IOException(args[0] + " is not a directory!");
    }
    else
    {
      FileStatus[] datasourceDirectories = fs.listStatus(srcDir);
      for(FileStatus datasourceDirectory : datasourceDirectories)
      {
        System.out.println(datasourceDirectory.getPath() + " isDir?" +datasourceDirectory.isDir());
        if (!datasourceDirectory.isDir())
        {
          throw new IOException("Top level should just contains directories :" + datasourceDirectory.getPath());
        }
       
        String dirName = datasourceDirectory.getPath().getName();
       
        if (dirName.equals("_logs"))
        {
          continue;
        }
       
        Path destPath = new Path(destDir + "/" + dirName);
        System.out.println("dest directory path: " + destPath);
       
        if (!fs.exists(destPath))
         {
          System.out.println("create datasource directory [" + destDir + "/" + dirName + "]");
          fs.mkdirs(destPath);
         }
       
        FileStatus[] evts = fs.listStatus(datasourceDirectory.getPath(),new EventFileFilter());
        for(FileStatus eventFile : evts
        {

          Path eventFilePath = eventFile.getPath();
          String filename = eventFilePath.getName();
          System.out.println("src dir File: ["+  filename+"]");         
          Path destFilePath = new Path(destDir + "/" + dirName + "/" + filename);
          if (!fs.exists(destFilePath))
          {
            System.out.println("Moving File: [" + destFilePath +"]");
            fs.rename(eventFilePath, destFilePath);
          }
          else
          {
            System.out.println("Need to merge! : [" + destFilePath +"]");
            String strMrPath = datasourceDirectory.getPath().toString()+ "/" + "MR_" + System.currentTimeMillis();
            Path mrPath = new Path(strMrPath);
            System.out.println("\t New MR directory : [" + mrPath +"]");
            // Create MR input Dir
            fs.mkdirs(mrPath);
            // Move Input files
            fs.rename(eventFilePath, new Path(strMrPath+"/1.done"));
            fs.rename(destFilePath, new Path(strMrPath+"/2.done"));
           
            // Merge
            String[] mergeArgs = new String[2];
            mergeArgs[0] = strMrPath;
            mergeArgs[1] = strMrPath + "/mrOutput";
            System.out.println("\t Running Merge! : output [" + mergeArgs[1] +"]");
            int res = ToolRunner.run(new ChukwaConfiguration(),new MoveOrMergeRecordFile(), mergeArgs);
            System.out.println("MR exit status: " + res);
            if (res == 0)
            {
              System.out.println("\t Moving output file : to [" + destFilePath +"]");
              fs.rename(new Path(mergeArgs[1]+"/part-00000"), destFilePath);
View Full Code Here

  ChukwaAgentController c;
  Connector httpConnector;
  //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

      ChukwaAgent agent = new ChukwaAgent();
      boolean failed=false;
      HttpConnector connector = new HttpConnector(agent, "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());
View Full Code Here

   
    try {
      System.out.println("usage:  CollectorStub [portno] [pretend]");
      System.out.println("note: if no portno defined, defaults to value in chukwa-site.xml");
      ChukwaConfiguration conf = new ChukwaConfiguration();
      int portNum = conf.getInt("chukwaCollector.http.port", 9999);

      if(args.length != 0)
        portNum = Integer.parseInt(args[0]);
      if(args.length > 1) {
        if(args[1].equals("pretend"))
View Full Code Here

  private Timer statTimer = null;
  private volatile long dataSize = 0;

  public SeqFileWriter() throws IOException
  {
    conf = new ChukwaConfiguration(true);
    init();
  }
View Full Code Here

   * Initializes listener, but does not bind to socket.
   * @param a the agent to control
   */
  public AgentControlSocketListener(ChukwaAgent a)
  {
    ChukwaConfiguration conf = new ChukwaConfiguration();
    this.setDaemon(false); //to keep the local agent alive
    agent = a;
    portno = conf.getInt("chukwaAgent.agent.control.port", 9093);
    log.info("AgentControlSocketListerner port set to " + portno);
    this.setName("control socket listener");
  }
View Full Code Here

      Thread.sleep(1000);
      ChukwaAgent agent = new ChukwaAgent();
      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();
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

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.