ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [08/16] ignite git commit: WIP.
Date Tue, 15 Mar 2016 13:35:17 GMT
WIP.


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

Branch: refs/heads/ignite-2813
Commit: 93d2e8471a7ea4402dd04fd3d08c9733aa4b7bc0
Parents: 92eb571
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Mar 15 15:42:26 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Mar 15 15:42:26 2016 +0300

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/93d2e847/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 98804d3..9f34f68 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
@@ -801,18 +801,14 @@ public class IgfsMetaManager extends IgfsManager {
         if (!parentInfo.isDirectory())
             throw fsException(new IgfsPathIsNotDirectoryException("Parent file is not a directory:
" + parentInfo));
 
-        Map<String, IgfsListingEntry> parentListing = parentInfo.listing();
+        Map<String, IgniteUuid> parentListing = parentInfo.listing2();
 
-        assert parentListing != null;
+        IgniteUuid fileId = parentListing.get(fileName);
 
-        IgfsListingEntry entry = parentListing.get(fileName);
+        if (fileId != null)
+            return fileId;
 
-        if (entry != null)
-            return entry.fileId();
-
-        IgniteUuid fileId = newFileInfo.id();
-
-        if (!id2InfoPrj.putIfAbsent(fileId, newFileInfo))
+        if (!id2InfoPrj.putIfAbsent(newFileInfo.id(), newFileInfo))
             throw fsException("Failed to add file details into cache: " + newFileInfo);
 
         id2InfoPrj.invoke(parentId, new ListingAdd(fileName, new IgfsListingEntry(newFileInfo)));
@@ -915,7 +911,7 @@ public class IgfsMetaManager extends IgfsManager {
                     assert dstTargetInfo.isDirectory();
 
                     // 7. Last check: does destination target already have listing entry
with the same name?
-                    if (dstTargetInfo.listing().containsKey(dstName)) {
+                    if (dstTargetInfo.listing2().containsKey(dstName)) {
                         throw new IgfsPathAlreadyExistsException("Failed to perform move
because destination already " +
                             "contains entry with the same name existing file [src=" + srcPath
+
                             ", dst=" + dstPath + ']');
@@ -1046,7 +1042,7 @@ public class IgfsMetaManager extends IgfsManager {
                 fileId + ']'));
 
         IgfsListingEntry srcEntry = srcInfo.listing().get(srcFileName);
-        IgfsListingEntry destEntry = destInfo.listing().get(destFileName);
+        IgniteUuid destEntry = destInfo.listing2().get(destFileName);
 
         // If source file does not exist or was re-created.
         if (srcEntry == null || !srcEntry.fileId().equals(fileId))
@@ -1483,13 +1479,9 @@ public class IgfsMetaManager extends IgfsManager {
 
                     IgfsFileInfo trashInfo = id2InfoPrj.get(trashId);
 
-                    if (trashInfo != null) {
-                        Map<String, IgfsListingEntry> listing = trashInfo.listing();
-
-                        if (listing != null && !listing.isEmpty()) {
-                            for (IgfsListingEntry entry : listing.values())
-                                ids.add(entry.fileId());
-                        }
+                    if (trashInfo != null && trashInfo.hasChildren()) {
+                        for (IgniteUuid entry : trashInfo.listing2().values())
+                            ids.add(entry);
                     }
                 }
 


Mime
View raw message