[CARBONDATA-2970]lock object creation fix for viewFS Problem when default fs is set to ViewFS then the drop table and load fails with exception saying failed to get lock like meta.lock, tablestatus.lock. This is because when getting locktypeObject we wre not checking for viewfs and we are returning it as local file system and failes while acquiring
Solution Check for viewFS also when trying to get the lock object This closes #2762 Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/1b4109d5 Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/1b4109d5 Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/1b4109d5 Branch: refs/heads/branch-1.5 Commit: 1b4109d5b2badc0c10d5522502bd799c6325263c Parents: 5d17ff4 Author: akashrn5 <akashnilu...@gmail.com> Authored: Tue Sep 25 18:59:04 2018 +0530 Committer: kumarvishal09 <kumarvishal1...@gmail.com> Committed: Thu Sep 27 16:46:11 2018 +0530 ---------------------------------------------------------------------- .../java/org/apache/carbondata/core/locks/CarbonLockFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/carbondata/blob/1b4109d5/core/src/main/java/org/apache/carbondata/core/locks/CarbonLockFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/locks/CarbonLockFactory.java b/core/src/main/java/org/apache/carbondata/core/locks/CarbonLockFactory.java index 91677a6..79bad6c 100644 --- a/core/src/main/java/org/apache/carbondata/core/locks/CarbonLockFactory.java +++ b/core/src/main/java/org/apache/carbondata/core/locks/CarbonLockFactory.java @@ -71,7 +71,8 @@ public class CarbonLockFactory { lockTypeConfigured = CarbonCommonConstants.CARBON_LOCK_TYPE_S3; return new S3FileLock(absoluteLockPath, lockFile); - } else if (absoluteLockPath.startsWith(CarbonCommonConstants.HDFSURL_PREFIX)) { + } else if (absoluteLockPath.startsWith(CarbonCommonConstants.HDFSURL_PREFIX) || absoluteLockPath + .startsWith(CarbonCommonConstants.VIEWFSURL_PREFIX)) { lockTypeConfigured = CarbonCommonConstants.CARBON_LOCK_TYPE_HDFS; return new HdfsFileLock(absoluteLockPath, lockFile); } else {