accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [10/26] git commit: ACCUMULO-2061 Propagate errors on delete or mkdirs failure.
Date Fri, 14 Mar 2014 21:11:36 GMT
ACCUMULO-2061 Propagate errors on delete or mkdirs failure.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/560af51c
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/560af51c
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/560af51c

Branch: refs/heads/ACCUMULO-2061
Commit: 560af51cac6e38da4829706292fa7b3f0d576336
Parents: e3adf78
Author: Josh Elser <elserj@apache.org>
Authored: Wed Mar 12 16:19:19 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Mar 12 16:19:19 2014 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/server/util/ChangeSecret.java     | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/560af51c/server/base/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java b/server/base/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
index f0dcd14..2926a3f 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
@@ -147,8 +147,14 @@ public class ChangeSecret {
     // Need to recreate the instanceId on all of them to keep consistency
     for (Volume v : fs.getVolumes()) {
       final Path instanceId = ServerConstants.getInstanceIdLocation(v);
-      v.getFileSystem().delete(instanceId, true);
-      v.getFileSystem().mkdirs(instanceId);
+      if (!v.getFileSystem().delete(instanceId, true)) {
+        throw new IOException("Could not recursively delete " + instanceId);
+      }
+
+      if (!v.getFileSystem().mkdirs(instanceId)) {
+        throw new IOException("Could not create directory " + instanceId);
+      }
+
       v.getFileSystem().create(new Path(instanceId, newInstanceId)).close();
     }
   }


Mime
View raw message