ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [39/51] [abbrv] ignite git commit: IGNITE-1740: Node id in IGFS file lock id.
Date Thu, 22 Oct 2015 09:13:02 GMT
IGNITE-1740: Node id in IGFS file lock id.


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

Branch: refs/heads/ignite-1282
Commit: f619e094356959cf749243989e3c3c17daf93d50
Parents: 75fb19d
Author: iveselovskiy <iveselovskiy@gridgain.com>
Authored: Tue Oct 20 15:49:21 2015 +0300
Committer: thatcoach <ppozerov@list.ru>
Committed: Tue Oct 20 15:49:21 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/igfs/IgfsMetaManager.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f619e094/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index c016e46..e75fe51 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -526,7 +526,7 @@ public class IgfsMetaManager extends IgfsManager {
      * @return New file info with lock set, or null if the info passed in is already locked.
      * @throws IgniteCheckedException In case lock is already set on that file.
      */
-    private static @Nullable IgfsFileInfo lockInfo(IgfsFileInfo info, boolean isDeleteLock)
{
+    private @Nullable IgfsFileInfo lockInfo(IgfsFileInfo info, boolean isDeleteLock) {
          assert info != null;
 
          if (info.lockId() != null)
@@ -537,12 +537,16 @@ public class IgfsMetaManager extends IgfsManager {
 
     /**
      * Gets a new lock id.
+     * The returned Id #globalId() method will return the Id of the node which locked the
file.
      *
      * @param isDeleteLock if this is special delete lock.
      * @return The new lock id.
      */
-    private static IgniteUuid composeLockId(boolean isDeleteLock) {
-        return isDeleteLock ? DELETE_LOCK_ID : IgniteUuid.randomUuid();
+    private IgniteUuid composeLockId(boolean isDeleteLock) {
+        if (isDeleteLock)
+            return DELETE_LOCK_ID;
+
+        return IgniteUuid.fromUuid(locNode.id());
     }
 
     /**


Mime
View raw message