Package org.apache.hadoop.chukwa.util

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


        }
        String query = "replace into " + this.table + "_" + partition + "_"
            + timeWindowType + " (select " + fields + " from " + table
            + " where " + dateclause + groupBy + ")";
        log.debug(query);
        db.execute(query);
        if (previousStart == start) {
          start = start + (interval * 60000);
          end = start + (interval * 60000);
          previousStart = start;
        }
View Full Code Here


                 + File.separator + "database_create_tables.sql");
    buffer = readFile(aFile);
    String tables[] = buffer.split(";");
    for(String table : tables) {
      if(table.length()>5) {
        db.execute(table);
      }
    }
    db.close();
    for(int i=0;i<timeWindow.length;i++) {
      TableCreator tc = new TableCreator();
View Full Code Here

      while(rs.next()) {
        String table = rs.getString(1);
        list.add(table);
      }
      for(String table : list) {
        db.execute("drop table "+table);
      }
    } catch(Throwable ex) {
    } finally {
      if(db!=null) {
        db.close();
View Full Code Here

                 + File.separator + "database_create_tables.sql");
    buffer = readFile(aFile);
    String tables[] = buffer.split(";");
    for(String table : tables) {
      if(table.length()>5) {
        db.execute(table);
      }
    }
    db.close();
    for(int i=0;i<timeWindow.length;i++) {
      TableCreator tc = new TableCreator();
View Full Code Here

      while(rs.next()) {
        String table = rs.getString(1);
        list.add(table);
      }
      for(String table : list) {
        db.execute("drop table "+table);
      }
    } catch(Throwable ex) {
    } finally {
      if(db!=null) {
        db.close();
View Full Code Here

                 + File.separator + "database_create_tables.sql");
    buffer = readFile(aFile);
    String tables[] = buffer.split(";");
    for(String table : tables) {
      if(table.length()>5) {
        db.execute(table);
      }
    }
    db.close();
    for(int i=0;i<timeWindow.length;i++) {
      TableCreator tc = new TableCreator();
View Full Code Here

      while(rs.next()) {
        String table = rs.getString(1);
        list.add(table);
      }
      for(String table : list) {
        db.execute("drop table "+table);
      }
    } catch(Throwable ex) {
    } finally {
      if(db!=null) {
        db.close();
View Full Code Here

          log.debug("creating table: " + query);
          String createPartition = query.replaceFirst(table + "_template",
              table + "_" + partition + "_" + parts[parts.length - 1]);
          createPartition = createPartition.replaceFirst("TABLE",
              "TABLE IF NOT EXISTS");
          dbw.execute(createPartition);
          partition++;
          createPartition = query.replaceFirst(table + "_template", table
              + "_" + partition + "_" + parts[parts.length - 1]);
          createPartition = createPartition.replaceFirst("TABLE",
              "TABLE IF NOT EXISTS");
View Full Code Here

          partition++;
          createPartition = query.replaceFirst(table + "_template", table
              + "_" + partition + "_" + parts[parts.length - 1]);
          createPartition = createPartition.replaceFirst("TABLE",
              "TABLE IF NOT EXISTS");
          dbw.execute(createPartition);
          partition++;
          createPartition = query.replaceFirst(table + "_template", table
              + "_" + partition + "_" + parts[parts.length - 1]);
          createPartition = createPartition.replaceFirst("TABLE",
              "TABLE IF NOT EXISTS");
View Full Code Here

          partition++;
          createPartition = query.replaceFirst(table + "_template", table
              + "_" + partition + "_" + parts[parts.length - 1]);
          createPartition = createPartition.replaceFirst("TABLE",
              "TABLE IF NOT EXISTS");
          dbw.execute(createPartition);
        }
      } catch (NumberFormatException e) {
        log.error("Error in parsing table partition number, skipping table:"
            + tableList[0]);
      } catch (ArrayIndexOutOfBoundsException e) {
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.