Package org.apache.hadoop.chukwa.util

Examples of org.apache.hadoop.chukwa.util.DatabaseWriter.query()


  if (timestamp != null) {
      // get simple value
            try {
    String query = getSingleQuery(SystemMetricsHome.table,"timestamp",timestamp);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        SystemMetrics obj = createSystemMetrics(rs);
        return obj;
    }
      } catch (Exception e) {
View Full Code Here


    Map<String, String> criteriaMap = new HashMap<String,String>();
    criteriaMap.put("timestamp",convertLongToDateString(Long.parseLong(timestamp)));
    criteriaMap.put("host",host);

    String query = getCriteriaQuery(SystemMetricsHome.table,criteriaMap);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        SystemMetrics obj = createSystemMetrics(rs);
        return obj;
    }
      } catch (Exception e) {
View Full Code Here

  Collection<SystemMetrics> collection = new Vector<SystemMetrics>();

  try {
      String query = getTimeBetweenQuery(SystemMetricsHome.table,starttime,endtime);     
      ResultSet rs = dbw.query(query);
      while (rs.next()) {
    SystemMetrics obj = createSystemMetrics(rs);
    collection.add(obj);
      }
  } catch (Exception e) {
View Full Code Here

  if (timestamp != null) {
      // get simple value
            try {
    String query = getSingleQuery(DfsFsNameSystemHome.table,"timestamp",timestamp);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        DfsFsNameSystem obj = createDfsFsNameSystem(rs);
        return obj;
    }
      } catch (Exception e) {
View Full Code Here

    Map<String, String> criteriaMap = new HashMap<String,String>();
    criteriaMap.put("timestamp",convertLongToDateString(Long.parseLong(timestamp)));
    criteriaMap.put("host",host);

    String query = getCriteriaQuery(DfsFsNameSystemHome.table,criteriaMap);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        DfsFsNameSystem obj = createDfsFsNameSystem(rs);
        return obj;
    }
      } catch (Exception e) {
View Full Code Here

  Collection<DfsFsNameSystem> collection = new Vector<DfsFsNameSystem>();

  try {
      String query = getTimeBetweenQuery(DfsFsNameSystemHome.table,starttime,endtime);     
      ResultSet rs = dbw.query(query);
      while (rs.next()) {
    DfsFsNameSystem obj = createDfsFsNameSystem(rs);
    collection.add(obj);
      }
  } catch (Exception e) {
View Full Code Here

  if (task_id != null) {
      // get simple value
            try {
    String query = getSingleQuery(MrTaskHome.table,"task_id",task_id);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        MrTask obj = createMrTask(rs);
        return obj;
    }
      } catch (Exception e) {
View Full Code Here

  if (job_id != null) {
      // get simple value
            try {
    String query = getSingleQuery(MrJobHome.table,"job_id",job_id);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        MrJob obj = createMrJob(rs);
        return obj;
    }
      } catch (Exception e) {
View Full Code Here

 
  if (job_id != null) {
      // get simple value
            try {
    String query = getSingleQuery(MrJobConfHome.table,"job_id",job_id);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        MrJobConf obj = createMrJobConf(rs);
        return obj;
    }
      } catch (Exception e) {
View Full Code Here

      fail(e.toString());
    }
    DatabaseWriter db = null;
    try {
      db = new DatabaseWriter(cluster);
      ResultSet rs = db.query("show tables");
      ArrayList<String> list = new ArrayList<String>();
      while(rs.next()) {
        String table = rs.getString(1);
        list.add(table);
      }
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.