Author: olga
Date: Mon Oct  6 11:05:25 2008
New Revision: 702215

URL: http://svn.apache.org/viewvc?rev=702215&view=rev
Log:
PIG-457: report 100% on successful jobs only

Modified:
    incubator/pig/branches/types/CHANGES.txt
    
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/LocalLauncher.java
    
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java

Modified: incubator/pig/branches/types/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/CHANGES.txt?rev=702215&r1=702214&r2=702215&view=diff
==============================================================================
--- incubator/pig/branches/types/CHANGES.txt (original)
+++ incubator/pig/branches/types/CHANGES.txt Mon Oct  6 11:05:25 2008
@@ -271,3 +271,5 @@
     PIG-335: lineage (sms vi olgan)
 
     PIG-464: bag schema definition (pradeepk via olgan)
+
+    PIG-457: report 100% on successful jobs only (shravanmn via olgan)

Modified: 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/LocalLauncher.java
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/LocalLauncher.java?rev=702215&r1=702214&r2=702215&view=diff
==============================================================================
--- 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/LocalLauncher.java
 (original)
+++ 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/LocalLauncher.java
 Mon Oct  6 11:05:25 2008
@@ -56,13 +56,17 @@
         new Thread(jc).start();
 
         double lastProg = -1;
+        int perCom = 0;
         while(!jc.allFinished()){
             try {
                 Thread.sleep(sleepTime);
             } catch (InterruptedException e) {}
             double prog = calculateProgress(jc, jobClient)/numMRJobs;
-            if(prog>lastProg)
-                log.info((int)(prog * 100) + "% complete");
+            if(prog>=(lastProg+0.01)){
+                perCom = (int)(prog * 100);
+                if(perCom!=100)
+                    log.info( perCom + "% complete");
+            }
             lastProg = prog;
         }
         // Look to see if any jobs failed.  If so, we need to report that.
@@ -84,7 +88,8 @@
             }
 
         jc.stop(); 
-        
+        log.info( "100% complete");
+        log.info("Success!");
         return true;
     }
 

Modified: 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java?rev=702215&r1=702214&r2=702215&view=diff
==============================================================================
--- 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java
 (original)
+++ 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java
 Mon Oct  6 11:05:25 2008
@@ -73,13 +73,17 @@
         new Thread(jc).start();
 
         double lastProg = -1;
+        int perCom = 0;
         while(!jc.allFinished()){
             try {
                 Thread.sleep(sleepTime);
             } catch (InterruptedException e) {}
             double prog = calculateProgress(jc, jobClient)/numMRJobs;
-            if(prog>lastProg)
-                log.info((int)(prog * 100) + "% complete");
+            if(prog>=(lastProg+0.01)){
+                perCom = (int)(prog * 100);
+                if(perCom!=100)
+                    log.info( perCom + "% complete");
+            }
             lastProg = prog;
         }
         // Look to see if any jobs failed.  If so, we need to report that.
@@ -101,7 +105,8 @@
             }
 
         jc.stop(); 
-        
+        log.info( "100% complete");
+        log.info("Success!");
         return true;
     }
 


Reply via email to