You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/03/17 21:16:19 UTC

ignite git commit: Minors for move.

Repository: ignite
Updated Branches:
  refs/heads/ignite-igfs-refactoring b4079ceb7 -> a6716ffcb


Minors for move.


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

Branch: refs/heads/ignite-igfs-refactoring
Commit: a6716ffcb22ab26ea7e030e9a686173addb096d6
Parents: b4079ce
Author: thatcoach <pp...@list.ru>
Authored: Thu Mar 17 23:10:47 2016 +0300
Committer: thatcoach <pp...@list.ru>
Committed: Thu Mar 17 23:10:47 2016 +0300

----------------------------------------------------------------------
 .../processors/igfs/IgfsMetaManager.java         | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a6716ffc/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 21e0e86..e419117 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
@@ -900,14 +900,14 @@ public class IgfsMetaManager extends IgfsManager {
                             "structure changed concurrently [src=" + srcPath + ", dst=" + dstPath + ']');
 
                     // Addiional check: is destination directory?
-                    IgfsFileInfo destInfo = lockInfos.get(dstPathIds.lastId());
+                    IgfsFileInfo dstParentInfo = lockInfos.get(dstPathIds.lastId());
 
-                    if (destInfo.isFile())
+                    if (dstParentInfo.isFile())
                         throw new IgfsPathAlreadyExistsException("Failed to perform move because destination points " +
                             "to existing file [src=" + srcPath + ", dst=" + dstPath + ']');
 
                     // Additional check: does destination already has child with the same name?
-                    if (destInfo.hasChild(dstName))
+                    if (dstParentInfo.hasChild(dstName))
                         throw new IgfsPathAlreadyExistsException("Failed to perform move because destination already " +
                             "contains entry with the same name existing file [src=" + srcPath +
                             ", dst=" + dstPath + ']');
@@ -915,19 +915,18 @@ public class IgfsMetaManager extends IgfsManager {
                     // Actual move: remove from source parent and add to destination target.
                     IgfsFileInfo srcParentInfo = lockInfos.get(srcPathIds.lastParentId());
 
-                    IgfsListingEntry entry = srcParentInfo.listing().get(srcPathIds.lastPart());
+                    IgfsFileInfo srcInfo = lockInfos.get(srcPathIds.lastId());
+                    String srcName = srcPathIds.lastPart();
+                    IgfsListingEntry srcEntry = srcParentInfo.listing().get(srcName);
 
-                    transferEntry(entry, srcPathIds.lastParentId(), srcPathIds.lastPart(),
-                        dstPathIds.lastId(), dstName);
+                    transferEntry(srcEntry, srcParentInfo.id(), srcName, dstParentInfo.id(), dstName);
 
                     tx.commit();
 
-                    IgfsPath realNewPath = new IgfsPath(dstPathIds.path(), dstName);
-
-                    IgfsFileInfo moved = lockInfos.get(srcPathIds.lastId());
+                    IgfsPath newPath = new IgfsPath(dstPathIds.path(), dstName);
 
                     // Set the new path to the info to simplify event creation:
-                    return IgfsFileInfo.builder(moved).path(realNewPath).build();
+                    return IgfsFileInfo.builder(srcInfo).path(newPath).build();
                 }
                 finally {
                     tx.close();