Examples of ChukwaSearchResult


Examples of org.apache.hadoop.chukwa.extraction.engine.ChukwaSearchResult

    return fileName;
  }

  public static void main(String[] args) throws DataSourceException {
    ChukwaRecordDataSource ds = new ChukwaRecordDataSource();
    SearchResult result = new ChukwaSearchResult();
    result.setRecords(new TreeMap<Long, List<Record>>());
    String cluster = args[0];
    String dataSource = args[1];
    long t0 = Long.parseLong(args[2]);
    long t1 = Long.parseLong(args[3]);
    String filter = null;
    Token token = null;

    if (args.length >= 5 && !args[4].equalsIgnoreCase("null")) {
      filter = args[4];
    }
    if (args.length == 6) {
      token = new Token();
      token.key = args[5];
      System.out.println("token :" + token.key);
    }

    System.out.println("cluster :" + cluster);
    System.out.println("dataSource :" + dataSource);
    System.out.println("t0 :" + t0);
    System.out.println("t1 :" + t1);
    System.out.println("filter :" + filter);

    ds.search(result, cluster, dataSource, t0, t1, filter, token);
    TreeMap<Long, List<Record>> records = result.getRecords();
    Iterator<Long> it = records.keySet().iterator();

    while (it.hasNext()) {
      long ts = it.next();
      System.out.println("\n\nTimestamp: " + new Date(ts));
      List<Record> list = records.get(ts);
      for (int i = 0; i < list.size(); i++) {
        System.out.println(list.get(i));
      }
    }

    if (result.getToken() != null) {
      System.out.println("Key -->" + result.getToken().key);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.extraction.engine.ChukwaSearchResult

      throw new RuntimeException(e);
    }
   
    String filter = null;
    RecordDS dao = new RecordDS();
    SearchResult result = new ChukwaSearchResult();
   
    TreeMap<Long, List<Record>> records = new TreeMap<Long,List<Record>> ();
    result.setRecords(records);
   
    dao.search(result,"output2","NameNode",t0,t1,filter);
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.extraction.engine.ChukwaSearchResult

    return fileName;
  }

  public static void main(String[] args) throws DataSourceException {
    ChukwaRecordDataSource ds = new ChukwaRecordDataSource();
    SearchResult result = new ChukwaSearchResult();
    result.setRecords(new TreeMap<Long, List<Record>>());
    String cluster = args[0];
    String dataSource = args[1];
    long t0 = Long.parseLong(args[2]);
    long t1 = Long.parseLong(args[3]);
    String filter = null;
    Token token = null;

    if (args.length >= 5 && !args[4].equalsIgnoreCase("null")) {
      filter = args[4];
    }
    if (args.length == 6) {
      token = new Token();
      token.key = args[5];
      System.out.println("token :" + token.key);
    }

    System.out.println("cluster :" + cluster);
    System.out.println("dataSource :" + dataSource);
    System.out.println("t0 :" + t0);
    System.out.println("t1 :" + t1);
    System.out.println("filter :" + filter);

    ds.search(result, cluster, dataSource, t0, t1, filter, token);
    TreeMap<Long, List<Record>> records = result.getRecords();
    Iterator<Long> it = records.keySet().iterator();

    while (it.hasNext()) {
      long ts = it.next();
      System.out.println("\n\nTimestamp: " + new Date(ts));
      List<Record> list = records.get(ts);
      for (int i = 0; i < list.size(); i++) {
        System.out.println(list.get(i));
      }
    }

    if (result.getToken() != null) {
      System.out.println("Key -->" + result.getToken().key);
    }
  }
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.