Repository: giraph
Updated Branches:
  refs/heads/trunk c8db59b6a -> 5a58a7754


GIRAPH-983 Remove checkpoint related error messages from console


Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/5a58a775
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/5a58a775
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/5a58a775

Branch: refs/heads/trunk
Commit: 5a58a775403afb89fd24918ee4abd95046cfd7d5
Parents: c8db59b
Author: Sergey Edunov <[email protected]>
Authored: Tue Jan 13 16:32:04 2015 -0800
Committer: Sergey Edunov <[email protected]>
Committed: Tue Jan 13 16:44:34 2015 -0800

----------------------------------------------------------------------
 CHANGELOG                                       |  3 ++
 .../apache/giraph/utils/CheckpointingUtils.java | 34 +++++++++++---------
 2 files changed, 21 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/5a58a775/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 26164f5..ab2a21f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,9 @@
 Giraph Change Log
 
 Release 1.2.0 - unreleased
+
+  GIRAPH-983 Remove checkpoint related error messages from console (edunov)
+
   GIRAPH-978 Giraph-Debugger Test Graphs not working (nishantgandhi99 via 
edunov)
 
   GIRAPH-979: Add type of input to 'missing input' error message (majakabiljo)

http://git-wip-us.apache.org/repos/asf/giraph/blob/5a58a775/giraph-core/src/main/java/org/apache/giraph/utils/CheckpointingUtils.java
----------------------------------------------------------------------
diff --git 
a/giraph-core/src/main/java/org/apache/giraph/utils/CheckpointingUtils.java 
b/giraph-core/src/main/java/org/apache/giraph/utils/CheckpointingUtils.java
index f431260..2a6f785 100644
--- a/giraph-core/src/main/java/org/apache/giraph/utils/CheckpointingUtils.java
+++ b/giraph-core/src/main/java/org/apache/giraph/utils/CheckpointingUtils.java
@@ -103,24 +103,26 @@ public class CheckpointingUtils {
    */
   public static long getLastCheckpointedSuperstep(
       FileSystem fs, String checkpointBasePath) throws IOException {
-    FileStatus[] fileStatusArray =
-        fs.listStatus(new Path(checkpointBasePath),
-            new FinalizedCheckpointPathFilter());
-    if (fileStatusArray == null) {
-      return -1;
-    }
-    long lastCheckpointedSuperstep = Long.MIN_VALUE;
-    for (FileStatus file : fileStatusArray) {
-      long superstep = getCheckpoint(file);
-      if (superstep > lastCheckpointedSuperstep) {
-        lastCheckpointedSuperstep = superstep;
+    Path cpPath = new Path(checkpointBasePath);
+    if (fs.exists(cpPath)) {
+      FileStatus[] fileStatusArray =
+          fs.listStatus(cpPath, new FinalizedCheckpointPathFilter());
+      if (fileStatusArray != null) {
+        long lastCheckpointedSuperstep = Long.MIN_VALUE;
+        for (FileStatus file : fileStatusArray) {
+          long superstep = getCheckpoint(file);
+          if (superstep > lastCheckpointedSuperstep) {
+            lastCheckpointedSuperstep = superstep;
+          }
+        }
+        if (LOG.isInfoEnabled()) {
+          LOG.info("getLastGoodCheckpoint: Found last good checkpoint " +
+              lastCheckpointedSuperstep);
+        }
+        return lastCheckpointedSuperstep;
       }
     }
-    if (LOG.isInfoEnabled()) {
-      LOG.info("getLastGoodCheckpoint: Found last good checkpoint " +
-          lastCheckpointedSuperstep);
-    }
-    return lastCheckpointedSuperstep;
+    return -1;
   }
 
   /**

Reply via email to