Package org.apache.hadoop.chukwa.util

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


      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


              table = table + parts[i];
            }
            partition = partition - 3;
            String dropPartition = "drop table if exists " + table + "_"
                + partition + "_" + parts[parts.length - 1];
            dbw.execute(dropPartition);
            partition--;
            if(partition>=0) {
              dropPartition = "drop table if exists " + table + "_" + partition
                  + "_" + parts[parts.length - 1];
              dbw.execute(dropPartition);
View Full Code Here

            dbw.execute(dropPartition);
            partition--;
            if(partition>=0) {
              dropPartition = "drop table if exists " + table + "_" + partition
                  + "_" + parts[parts.length - 1];
              dbw.execute(dropPartition);
            }
          } catch (NumberFormatException e) {
            log
                .error("Error in parsing table partition number, skipping table:"
                    + tableList[0]);
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

          if(emptyPrimeKey) {
            groupBy = "group by "+dateclause;
          }
        String query = "insert ignore into "+this.table+"_"+interval+" (select "+fields+" from "+table+" where "+dateclause+groupBy+")";
        log.debug(query);
                db.execute(query);
                db.close();
            if(previousStart == start) {
              start = start + (interval*60000);
              end = start + (interval*60000);
                previousStart = start;
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.