carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [1/2] incubator-carbondata git commit: Fix CarbonSessionExample
Date Mon, 01 May 2017 15:54:51 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 3252e7ce2 -> 1edabc87a


Fix CarbonSessionExample

Fix CarbonSessionExample

Fix CarbonSessionExample


Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/b731123c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/b731123c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/b731123c

Branch: refs/heads/master
Commit: b731123c25dc2800e5264381f353d1409cdf7b8f
Parents: 3252e7c
Author: erlu <erlu@erludeMacBook-Pro.local>
Authored: Wed Apr 26 11:34:37 2017 +0800
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Mon May 1 21:23:56 2017 +0530

----------------------------------------------------------------------
 .../java/org/apache/carbondata/core/locks/LocalFileLock.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/b731123c/core/src/main/java/org/apache/carbondata/core/locks/LocalFileLock.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/locks/LocalFileLock.java b/core/src/main/java/org/apache/carbondata/core/locks/LocalFileLock.java
index 4cbfc7a..d357a11 100644
--- a/core/src/main/java/org/apache/carbondata/core/locks/LocalFileLock.java
+++ b/core/src/main/java/org/apache/carbondata/core/locks/LocalFileLock.java
@@ -26,6 +26,7 @@ import java.nio.channels.OverlappingFileLockException;
 import org.apache.carbondata.common.logging.LogService;
 import org.apache.carbondata.common.logging.LogServiceFactory;
 import org.apache.carbondata.core.constants.CarbonCommonConstants;
+import org.apache.carbondata.core.datastore.filesystem.CarbonFile;
 import org.apache.carbondata.core.datastore.impl.FileFactory;
 import org.apache.carbondata.core.metadata.CarbonTableIdentifier;
 import org.apache.carbondata.core.util.CarbonProperties;
@@ -149,8 +150,9 @@ public class LocalFileLock extends AbstractCarbonLock {
         try {
           fileOutputStream.close();
           // deleting the lock file after releasing the lock.
-          if (FileFactory.getCarbonFile(lockFilePath, FileFactory.getFileType(lockFilePath))
-              .delete()) {
+          CarbonFile lockFile = FileFactory
+                  .getCarbonFile(lockFilePath, FileFactory.getFileType(lockFilePath));
+          if (!lockFile.exists() || lockFile.delete()) {
             LOGGER.info("Successfully deleted the lock file " + lockFilePath);
           } else {
             LOGGER.error("Not able to delete the lock file " + lockFilePath);


Mime
View raw message