chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r764594 - /hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Macro.java
Date Mon, 13 Apr 2009 20:04:21 GMT
Author: eyang
Date: Mon Apr 13 20:04:21 2009
New Revision: 764594

URL: http://svn.apache.org/viewvc?rev=764594&view=rev
Log:
CHUKWA-122. Updated logic for finding time partition for Macro.  (Eric Yang)


Modified:
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Macro.java

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Macro.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Macro.java?rev=764594&r1=764593&r2=764594&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Macro.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Macro.java Mon Apr 13 20:04:21
2009
@@ -79,15 +79,16 @@
             String meta="";
             String[] table = null;
             if(forCharting) {
-                dbc.findTableNameForCharts(macro.substring(macro.indexOf("(")+1,macro.indexOf(")")),
start, end);
+                table = dbc.findTableNameForCharts(macro.substring(macro.indexOf("(")+1,macro.indexOf(")")),
start, end);
             } else {
-                dbc.findTableName(macro.substring(macro.indexOf("(")+1,macro.indexOf(")")),
start, end);
+                table = dbc.findTableName(macro.substring(macro.indexOf("(")+1,macro.indexOf(")")),
start, end);
             }
             try {
                 String cluster = System.getProperty("CLUSTER");
                 if(cluster==null) {
                     cluster="unknown";
                 }
+                db = new DatabaseWriter(cluster);
                 DatabaseMetaData dbMetaData = db.getConnection().getMetaData();
                 ResultSet rs = dbMetaData.getColumns ( null,null,table[0], null);
                 boolean first=true;
@@ -124,6 +125,7 @@
                         first=false;
                     }
                 }
+                db.close();
                 if(first) {
                     throw new SQLException("Table is undefined.");
                 }



Mime
View raw message