ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [34/46] ignite git commit: IGNITE-3854 IGFS: Support direct PROXY mode invocation in method: rename. This closes #1042.
Date Mon, 12 Sep 2016 08:26:48 GMT
IGNITE-3854 IGFS: Support direct PROXY mode invocation in method: rename. This closes #1042.


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

Branch: refs/heads/master
Commit: e1c7937dabb3508183ccbd9afa3f76d5aaa67236
Parents: 9389328
Author: tledkov-gridgain <tledkov@gridgain.com>
Authored: Wed Sep 7 17:39:13 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Sep 7 17:39:13 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/igfs/IgfsImpl.java      | 24 ++++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e1c7937d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 27618be..12d2830 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -710,17 +710,27 @@ public final class IgfsImpl implements IgfsEx {
                     throw new IgfsInvalidPathException("Cannot move file to a path with different
eviction " +
                         "exclude setting (need to copy and remove)");
 
-                if (mode != PRIMARY) {
-                    assert IgfsUtils.isDualMode(mode); // PROXY mode explicit usage is forbidden.
+                switch (mode) {
+                    case PRIMARY:
+                        meta.move(src, dest);
 
-                    await(src, dest);
+                        break;
 
-                    meta.renameDual(secondaryFs, src, dest);
+                    case DUAL_ASYNC:
+                    case DUAL_SYNC:
+                        await(src, dest);
 
-                    return null;
-                }
+                        meta.renameDual(secondaryFs, src, dest);
 
-                meta.move(src, dest);
+                        break;
+
+                    default:
+                        assert mode == PROXY : "Unknown mode: " + mode;
+
+                        secondaryFs.rename(src, dest);
+
+                        break;
+                }
 
                 return null;
             }


Mime
View raw message