chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r765369 - in /hadoop/chukwa: branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java
Date Wed, 15 Apr 2009 21:32:54 GMT
Author: eyang
Date: Wed Apr 15 21:32:53 2009
New Revision: 765369

URL: http://svn.apache.org/viewvc?rev=765369&view=rev
Log:
CHUKWA-121.  Added logic to detect partition number less than 0.  (Eric Yang)


Modified:
    hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java

Modified: hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java?rev=765369&r1=765368&r2=765369&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java
(original)
+++ hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java
Wed Apr 15 21:32:53 2009
@@ -68,9 +68,11 @@
                 + partition + "_" + parts[parts.length - 1];
             dbw.execute(dropPartition);
             partition--;
-            dropPartition = "drop table if exists " + table + "_" + partition
-                + "_" + parts[parts.length - 1];
-            dbw.execute(dropPartition);
+            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:"
@@ -81,6 +83,7 @@
           }
         }
       }
+      dbw.close();
     } catch (Exception e) {
       e.printStackTrace();
     }

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java?rev=765369&r1=765368&r2=765369&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java Wed
Apr 15 21:32:53 2009
@@ -68,9 +68,11 @@
                 + partition + "_" + parts[parts.length - 1];
             dbw.execute(dropPartition);
             partition--;
-            dropPartition = "drop table if exists " + table + "_" + partition
-                + "_" + parts[parts.length - 1];
-            dbw.execute(dropPartition);
+            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:"
@@ -81,6 +83,7 @@
           }
         }
       }
+      dbw.close();
     } catch (Exception e) {
       e.printStackTrace();
     }



Mime
View raw message