Package org.apache.hadoop.chukwa.database

Examples of org.apache.hadoop.chukwa.database.DatabaseConfig


    this.conf = conf;
    this.fs = fs;
  }

  private void initEnv(String cluster) throws Exception {
    mdlConfig = new DatabaseConfig();
    transformer = mdlConfig.startWith("metric.");
    conversion = new HashMap<String, Float>();
    normalize = mdlConfig.startWith("normalize.");
    dbTables = mdlConfig.startWith("report.db.name.");
    Iterator<?> entries = mdlConfig.iterator();
View Full Code Here


  public MetricDataLoader(String cluster) {
    initEnv(cluster);
  }

  private void initEnv(String cluster) {
    mdlConfig = new DatabaseConfig();
    transformer = mdlConfig.startWith("metric.");
    conversion = new HashMap<String, Float>();
    normalize = mdlConfig.startWith("normalize.");
    dbTables = mdlConfig.startWith("report.db.name.");
    Iterator<?> entries = mdlConfig.iterator();
View Full Code Here

    this.conf = conf;
    this.fs = fs;
  }

  private void initEnv(String cluster) throws Exception {
    mdlConfig = new DatabaseConfig();
    transformer = mdlConfig.startWith("metric.");
    conversion = new HashMap<String, Float>();
    normalize = mdlConfig.startWith("normalize.");
    dbTables = mdlConfig.startWith("report.db.name.");
    Iterator<?> entries = mdlConfig.iterator();
View Full Code Here

    public void run(){
       long updates = 0;
       boolean error = false;
       try{
           // SQL query to monitor database
           DatabaseConfig dbc = new DatabaseConfig();
           log.info("cluster:"+cluster);
           DatabaseWriter db = new DatabaseWriter(cluster);
           Calendar c = Calendar.getInstance();
           long now = c.getTimeInMillis();
           String[] tableName = dbc.findTableName("system_metrics", now, now);
           String query = "select unix_TIMESTAMP(now()) - unix_timestamp(max(timestamp)) as delay from "+tableName[0]+" ;";
           ResultSet rs = db.query(query);
           while(rs.next()) {
               long delay = rs.getLong(1);
               if(delay>600) {
                   log.error("Chukwa: "+cluster+": No new data for the past 30 minutes for system metrics");                  
                   error=true;
               }
           }
           query = "select count(*) as UpdatesPerHr from "+tableName[0]+" where Timestamp > date_sub(now(), interval 60 minute) ;";
           rs = db.query(query);
           while(rs.next()) {
               updates = rs.getLong(1);
               if(updates==0) {
                   log.error("Chukwa: "+cluster+": No system metrics data received for the past 60 minutes");                  
                   error=true;
               }
           }
           String[] hodTableNames = dbc.findTableName("HodJob", now, now);
           query = "select count(*) as UpdatesPerHr from "+hodTableNames[0]+" where StartTime > date_sub(now(), interval 60 minute) ;";
           rs = db.query(query);          
           while(rs.next()) {
               long updatesHod = rs.getLong(1);
               if(updatesHod==0) {
                   log.error("Chukwa: "+cluster+": No hod job data received for the past 60 minutes");
               }
           }
           String[] mrTableNames = dbc.findTableName("mr_job", now, now);
           query = "select count(*) as UpdatesPerHr from "+mrTableNames+" where FINISH_TIME > date_sub(now(), interval 1440 minute) ;";
           rs = db.query(query);                     
           while(rs.next()) {
               long updatesMR = rs.getLong(1);
               if(updatesMR==0) {
View Full Code Here

    this.conf = conf;
    this.fs = fs;
  }

  private void initEnv(String cluster) throws Exception {
    mdlConfig = new DatabaseConfig();
    transformer = mdlConfig.startWith("metric.");
    conversion = new HashMap<String, Float>();
    normalize = mdlConfig.startWith("normalize.");
    dbTables = mdlConfig.startWith("report.db.name.");
    Iterator<?> entries = mdlConfig.iterator();
View Full Code Here

    public void run(){
       long updates = 0;
       boolean error = false;
       try{
           // SQL query to monitor database
           DatabaseConfig dbc = new DatabaseConfig();
           log.info("cluster:"+cluster);
           DatabaseWriter db = new DatabaseWriter(cluster);
           Calendar c = Calendar.getInstance();
           long now = c.getTimeInMillis();
           String[] tableName = dbc.findTableName("system_metrics", now, now);
           String query = "select unix_TIMESTAMP(now()) - unix_timestamp(max(timestamp)) as delay from "+tableName[0]+" ;";
           ResultSet rs = db.query(query);
           while(rs.next()) {
               long delay = rs.getLong(1);
               if(delay>600) {
                   log.error("Chukwa: "+cluster+": No new data for the past 30 minutes for system metrics");                  
                   error=true;
               }
           }
           query = "select count(*) as UpdatesPerHr from "+tableName[0]+" where Timestamp > date_sub(now(), interval 60 minute) ;";
           rs = db.query(query);
           while(rs.next()) {
               updates = rs.getLong(1);
               if(updates==0) {
                   log.error("Chukwa: "+cluster+": No system metrics data received for the past 60 minutes");                  
                   error=true;
               }
           }
           String[] hodTableNames = dbc.findTableName("HodJob", now, now);
           query = "select count(*) as UpdatesPerHr from "+hodTableNames[0]+" where StartTime > date_sub(now(), interval 60 minute) ;";
           rs = db.query(query);          
           while(rs.next()) {
               long updatesHod = rs.getLong(1);
               if(updatesHod==0) {
                   log.error("Chukwa: "+cluster+": No hod job data received for the past 60 minutes");
               }
           }
           String[] mrTableNames = dbc.findTableName("mr_job", now, now);
           query = "select count(*) as UpdatesPerHr from "+mrTableNames+" where FINISH_TIME > date_sub(now(), interval 1440 minute) ;";
           rs = db.query(query);                     
           while(rs.next()) {
               long updatesMR = rs.getLong(1);
               if(updatesMR==0) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.chukwa.database.DatabaseConfig

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.