chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r787817 - in /hadoop/chukwa: branches/chukwa-0.2/CHANGES.txt branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java trunk/CHANGES.txt trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
Date Tue, 23 Jun 2009 20:08:03 GMT
Author: eyang
Date: Tue Jun 23 20:08:03 2009
New Revision: 787817

URL: http://svn.apache.org/viewvc?rev=787817&view=rev
Log:
CHUKWA-328. Handle empty sequence file more gracefully for MetricDataLoader. (Cheng Zhang
via Eric Yang)

Modified:
    hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt
    hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java

Modified: hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt?rev=787817&r1=787816&r2=787817&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt (original)
+++ hadoop/chukwa/branches/chukwa-0.2/CHANGES.txt Tue Jun 23 20:08:03 2009
@@ -72,6 +72,8 @@
 
   BUG FIXES
 
+    CHUKWA-328. Handle empty sequence file more gracefully for MetricDataLoader. (Cheng Zhang
via Eric Yang)
+
     CHUKWA-327. Remove START_TIME="0", FINISH_TIME="0" from JobHistory. (Cheng Zhang via
Eric Yang)
 
     CHUKWA-325. Removed hourly rolling flag from daily rolling. (Jerome Boulon via Eric Yang)

Modified: hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java?rev=787817&r1=787816&r2=787817&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
(original)
+++ hadoop/chukwa/branches/chukwa-0.2/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
Tue Jun 23 20:08:03 2009
@@ -189,16 +189,20 @@
 
     ChukwaRecordKey key = new ChukwaRecordKey();
     ChukwaRecord record = new ChukwaRecord();
+    String cluster = null;
+    int numOfRecords = 0;
     try {
       Pattern p = Pattern.compile("(.*)-\\d+$");
       int batch = 0;
       while (reader.next(key, record)) {
+    	numOfRecords++;
         if(first) { 
           try {
-            initEnv(RecordUtil.getClusterName(record));
+            cluster = RecordUtil.getClusterName(record);
+            initEnv(cluster);
             first=false;
           } catch(Exception ex) {
-            log.error("Initialization failed for: "+RecordUtil.getClusterName(record)+".
 Please check jdbc configuration.");
+            log.error("Initialization failed for: "+cluster+".  Please check jdbc configuration.");
             return false;
           }
         }
@@ -516,7 +520,7 @@
       int latencySeconds = ((int) (latencyMillis + 500)) / 1000;
       String logMsg = (isSuccessful ? "Saved" : "Error occurred in saving");
       log.info(logMsg + " (" + recordType + ","
-          + RecordUtil.getClusterName(record) + ") " + latencySeconds + " sec");
+          + cluster + ") " + latencySeconds + " sec. numOfRecords: " + numOfRecords);
       if (rs != null) {
         try {
           rs.close();

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=787817&r1=787816&r2=787817&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Tue Jun 23 20:08:03 2009
@@ -76,6 +76,8 @@
 
   BUG FIXES
 
+    CHUKWA-328. Handle empty sequence file more gracefully for MetricDataLoader. (Cheng Zhang
via Eric Yang)
+
     CHUKWA-327. Remove START_TIME="0", FINISH_TIME="0" from JobHistory. (Cheng Zhang via
Eric Yang)
 
     CHUKWA-325. Removed hourly rolling flag from daily rolling. (Jerome Boulon via Eric Yang)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java?rev=787817&r1=787816&r2=787817&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
Tue Jun 23 20:08:03 2009
@@ -189,16 +189,20 @@
 
     ChukwaRecordKey key = new ChukwaRecordKey();
     ChukwaRecord record = new ChukwaRecord();
+    String cluster = null;
+    int numOfRecords = 0;
     try {
       Pattern p = Pattern.compile("(.*)-\\d+$");
       int batch = 0;
       while (reader.next(key, record)) {
+    	numOfRecords++;
         if(first) { 
           try {
-            initEnv(RecordUtil.getClusterName(record));
+            cluster = RecordUtil.getClusterName(record);
+            initEnv(cluster);
             first=false;
           } catch(Exception ex) {
-            log.error("Initialization failed for: "+RecordUtil.getClusterName(record)+".
 Please check jdbc configuration.");
+            log.error("Initialization failed for: "+cluster+".  Please check jdbc configuration.");
             return false;
           }
         }
@@ -516,7 +520,7 @@
       int latencySeconds = ((int) (latencyMillis + 500)) / 1000;
       String logMsg = (isSuccessful ? "Saved" : "Error occurred in saving");
       log.info(logMsg + " (" + recordType + ","
-          + RecordUtil.getClusterName(record) + ") " + latencySeconds + " sec");
+          + cluster + ") " + latencySeconds + " sec. numOfRecords: " + numOfRecords);
       if (rs != null) {
         try {
           rs.close();



Mime
View raw message