You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/02/03 04:30:35 UTC

[GitHub] [hive] maheshk114 commented on a change in pull request #883: HIVE-22736 Support multiple encryption zones in replication

maheshk114 commented on a change in pull request #883: HIVE-22736 Support multiple encryption zones in replication
URL: https://github.com/apache/hive/pull/883#discussion_r373918256
 
 

 ##########
 File path: standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java
 ##########
 @@ -156,13 +157,21 @@ private ReplChangeManager(Configuration conf) throws MetaException {
           //Create default cm root
           Path cmroot = new Path(cmRootDir);
           createCmRoot(cmroot);
+          FileSystem cmRootFs = cmroot.getFileSystem(conf);
           HdfsEncryptionShim pathEncryptionShim = hadoopShims
-                  .createHdfsEncryptionShim(cmroot.getFileSystem(conf), conf);
+                  .createHdfsEncryptionShim(cmRootFs, conf);
           if (pathEncryptionShim.isPathEncrypted(cmroot)) {
-            String encryptionZonePath = pathEncryptionShim.getEncryptionZoneForPath(cmroot).getPath();
-            encryptionZones.put(encryptionZonePath, cmroot);
+            //cm root cannot be encrypted. So we move the current cmroot data to a cmroot in a encrypted zone
+            String encryptionZonePath = cmRootFs.getUri()
+                    + pathEncryptionShim.getEncryptionZoneForPath(cmroot).getPath();
+            cmRootFs.rename(cmroot, new Path(encryptionZonePath + encryptedCmRootDir));
 
 Review comment:
   move will cause issue if some repl dumps are already there with old cm path 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org