accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [10/25] git commit: ACCUMULO-2061 Propagate errors on delete or mkdirs failure.
Date Fri, 21 Mar 2014 02:13:13 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/7d48b1ad
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7d48b1ad
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7d48b1ad

Branch: refs/heads/master
Commit: 7d48b1adec6b124054f64ca0c87913ba5a4b6b7e
Parents: 550e5e6
Author: Josh Elser <elserj@apache.org>
Authored: Wed Mar 12 16:19:19 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Mar 20 18:59: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/7d48b1ad/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