commit df8c7e86eecda6f98a383a8b996f737571e8bcbf Author: Thejas M Nair Date: Sun Oct 29 16:32:58 2017 -0700 HIVE-17930.1.patch diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java index 95fa0a987c..66e30d726c 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java @@ -19,10 +19,13 @@ package org.apache.hadoop.hive.metastore; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileChecksum; @@ -52,7 +55,6 @@ private static Configuration conf; private String msUser; private String msGroup; - private FileSystem fs; private static final String ORIG_LOC_TAG = "user.original-loc"; static final String REMAIN_IN_TRASH_TAG = "user.remain-in-trash"; @@ -126,11 +128,11 @@ private ReplChangeManager(Configuration conf) throws MetaException { ReplChangeManager.cmroot = new Path(MetastoreConf.getVar(conf, ConfVars.REPLCMDIR)); ReplChangeManager.conf = conf; - fs = cmroot.getFileSystem(conf); + FileSystem cmFs = cmroot.getFileSystem(conf); // Create cmroot with permission 700 if not exist - if (!fs.exists(cmroot)) { - fs.mkdirs(cmroot); - fs.setPermission(cmroot, new FsPermission("700")); + if (!cmFs.exists(cmroot)) { + cmFs.mkdirs(cmroot); + cmFs.setPermission(cmroot, new FsPermission("700")); } UserGroupInformation usergroupInfo = UserGroupInformation.getCurrentUser(); msUser = usergroupInfo.getShortUserName(); @@ -172,7 +174,7 @@ int recycle(Path path, RecycleType type, boolean ifPurge) throws MetaException { try { int count = 0; - + FileSystem fs = path.getFileSystem(conf); if (fs.isDirectory(path)) { FileStatus[] files = fs.listStatus(path, hiddenFileFilter); for (FileStatus file : files) {