hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [24/49] hadoop git commit: HDFS-10516. Fix bug when warming up EDEK cache of more than one encryption zone. Contributed by Xiao Chen.
Date Thu, 16 Jun 2016 18:32:48 GMT
HDFS-10516. Fix bug when warming up EDEK cache of more than one encryption zone. Contributed
by Xiao Chen.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/709a814f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/709a814f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/709a814f

Branch: refs/heads/HDFS-7240
Commit: 709a814fe0153e86a37806796ea27c8252d9c6d1
Parents: 0accc33
Author: Andrew Wang <wang@apache.org>
Authored: Mon Jun 13 11:50:19 2016 -0700
Committer: Andrew Wang <wang@apache.org>
Committed: Mon Jun 13 11:50:19 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hdfs/server/namenode/EncryptionZoneManager.java    | 2 +-
 .../hadoop/hdfs/server/namenode/FSDirEncryptionZoneOp.java    | 3 +++
 .../org/apache/hadoop/hdfs/TestEncryptionZonesWithKMS.java    | 7 ++++++-
 3 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/709a814f/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/EncryptionZoneManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/EncryptionZoneManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/EncryptionZoneManager.java
index 41dbb59..511c616 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/EncryptionZoneManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/EncryptionZoneManager.java
@@ -416,7 +416,7 @@ public class EncryptionZoneManager {
     int index = 0;
     for (Map.Entry<Long, EncryptionZoneInt> entry : encryptionZones
         .entrySet()) {
-      ret[index] = entry.getValue().getKeyName();
+      ret[index++] = entry.getValue().getKeyName();
     }
     return ret;
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/709a814f/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirEncryptionZoneOp.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirEncryptionZoneOp.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirEncryptionZoneOp.java
index 2997179..2319741 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirEncryptionZoneOp.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirEncryptionZoneOp.java
@@ -370,6 +370,9 @@ final class FSDirEncryptionZoneOp {
           } else {
             NameNode.LOG.debug("Failed to warm up EDEKs.", ioe);
           }
+        } catch (Exception e) {
+          NameNode.LOG.error("Cannot warm up EDEKs.", e);
+          throw e;
         }
         try {
           Thread.sleep(retryInterval);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/709a814f/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZonesWithKMS.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZonesWithKMS.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZonesWithKMS.java
index b29a108..959e724 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZonesWithKMS.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZonesWithKMS.java
@@ -100,9 +100,14 @@ public class TestEncryptionZonesWithKMS extends TestEncryptionZones {
 
   @Test(timeout = 120000)
   public void testWarmupEDEKCacheOnStartup() throws Exception {
-    final Path zonePath = new Path("/TestEncryptionZone");
+    Path zonePath = new Path("/TestEncryptionZone");
     fsWrapper.mkdir(zonePath, FsPermission.getDirDefault(), false);
     dfsAdmin.createEncryptionZone(zonePath, TEST_KEY, NO_TRASH);
+    final String anotherKey = "k2";
+    zonePath = new Path("/TestEncryptionZone2");
+    DFSTestUtil.createKey(anotherKey, cluster, conf);
+    fsWrapper.mkdir(zonePath, FsPermission.getDirDefault(), false);
+    dfsAdmin.createEncryptionZone(zonePath, anotherKey, NO_TRASH);
 
     @SuppressWarnings("unchecked")
     KMSClientProvider spy = (KMSClientProvider) Whitebox


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message