Author: aching
Date: Wed Mar 21 06:46:27 2012
New Revision: 1303297

URL: http://svn.apache.org/viewvc?rev=1303297&view=rev
Log:
GIRAPH-162: BspCase.setup() should catch FileNotFoundException thrown
from org.apache.hadoop.fs.FileSystem.listStatus() (ekoontz via
aching).

Modified:
    incubator/giraph/trunk/CHANGELOG
    incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java

Modified: incubator/giraph/trunk/CHANGELOG
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/CHANGELOG?rev=1303297&r1=1303296&r2=1303297&view=diff
==============================================================================
--- incubator/giraph/trunk/CHANGELOG (original)
+++ incubator/giraph/trunk/CHANGELOG Wed Mar 21 06:46:27 2012
@@ -2,7 +2,11 @@ Giraph Change Log
 
 Release 0.2.0 - unreleased
 
-  GIRAPH-161 - Handling null messages and edges when initializing
+  GIRAPH-162: BspCase.setup() should catch FileNotFoundException
+  thrown from org.apache.hadoop.fs.FileSystem.listStatus() (ekoontz
+  via aching).
+
+  GIRAPH-161: Handling null messages and edges when initializing
   IntIntNullIntVertex (dlogothetis via aching).
 
   GIRAPH-156: Users should be able to set simple 'custom arguments'

Modified: incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java?rev=1303297&r1=1303296&r2=1303297&view=diff
==============================================================================
--- incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java 
(original)
+++ incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java Wed Mar 
21 06:46:27 2012
@@ -18,6 +18,7 @@
 
 package org.apache.giraph;
 
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.List;
 
@@ -174,14 +175,19 @@ public class BspCase extends TestCase im
             // Since local jobs always use the same paths, remove them
             Path oldLocalJobPaths = new Path(
                 GiraphJob.ZOOKEEPER_MANAGER_DIR_DEFAULT);
-            FileStatus [] fileStatusArr = hdfs.listStatus(oldLocalJobPaths);
-            for (FileStatus fileStatus : fileStatusArr) {
-                if (fileStatus.isDir() &&
+            FileStatus[] fileStatusArr;
+            try {
+                fileStatusArr = hdfs.listStatus(oldLocalJobPaths);
+                for (FileStatus fileStatus : fileStatusArr) {
+                    if (fileStatus.isDir() &&
                         fileStatus.getPath().getName().contains("job_local")) {
-                    System.out.println("Cleaning up local job path " +
-                                       fileStatus.getPath().getName());
-                    hdfs.delete(oldLocalJobPaths, true);
+                        System.out.println("Cleaning up local job path " +
+                            fileStatus.getPath().getName());
+                        hdfs.delete(oldLocalJobPaths, true);
+                    }
                 }
+            } catch (FileNotFoundException e) {
+                // ignore this FileNotFound exception and continue.
             }
             if (zkList == null) {
                 return;


Reply via email to