chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r996234 - in /incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa: dataloader/MetricDataLoader.java extraction/demux/PostProcessorManager.java
Date Sun, 12 Sep 2010 01:38:19 GMT
Author: eyang
Date: Sun Sep 12 01:38:19 2010
New Revision: 996234

URL: http://svn.apache.org/viewvc?rev=996234&view=rev
Log:
CHUKWA-506. Added retry logic for MetricDataLoader (William Bajzek via Eric Yang)

Modified:
    incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
    incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/PostProcessorManager.java

Modified: incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java?rev=996234&r1=996233&r2=996234&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
(original)
+++ incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
Sun Sep 12 01:38:19 2010
@@ -172,7 +172,7 @@ public class MetricDataLoader implements
     return( sb.toString()); 
   }
   
-  public boolean run() {
+  public boolean run() throws IOException {
     boolean first=true;
     log.info("StreamName: " + source.getName());
     SequenceFile.Reader reader = null;
@@ -503,9 +503,13 @@ public class MetricDataLoader implements
       log.error("SQLException: " + ex.getMessage());
       log.error("SQLState: " + ex.getSQLState());
       log.error("VendorError: " + ex.getErrorCode());
+      // throw an exception up the chain to give the PostProcessorManager a chance to retry
+      throw new IOException (ex);
     } catch (Exception e) {
       isSuccessful = false;
       log.error(ExceptionUtil.getStackTrace(e));
+      // throw an exception up the chain to give the PostProcessorManager a chance to retry
+      throw new IOException (e);
     } finally {
       if (batchMode && conn!=null) {
         try {
@@ -569,7 +573,7 @@ public class MetricDataLoader implements
     return true;
   }
 
-  public Boolean call() {
+  public Boolean call() throws IOException {
     return run();  
   }
   

Modified: incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/PostProcessorManager.java
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/PostProcessorManager.java?rev=996234&r1=996233&r2=996234&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/PostProcessorManager.java
(original)
+++ incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/PostProcessorManager.java
Sun Sep 12 01:38:19 2010
@@ -155,7 +155,16 @@ public class PostProcessorManager implem
                 processPostMoveTriggers(destFiles);
                 continue;
               }
+              } else {
+                  log.warn("Error in processDemuxOutput for :" + directoryToBeProcessed +
". Will try again.");
+                  if (errorCount > 3)
+                      moveToInErrorDirectory(directoryToBeProcessed,directory,chukwaPostProcessInErrorDir);

+                  else 
+                      errorCount++;
+                  continue;                
+              
             }
+            
             // if we are here it's because something bad happen during processing
             log.warn("Error in processDemuxOutput for :" + directoryToBeProcessed);
             moveToInErrorDirectory(directoryToBeProcessed,directory,chukwaPostProcessInErrorDir);




Mime
View raw message