ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [33/49] ignite git commit: IGNITE-3853 IGFS: Support direct PROXY mode invocation in method: update. This closes #1041.
Date Mon, 12 Sep 2016 11:19:12 GMT
IGNITE-3853 IGFS: Support direct PROXY mode invocation in method: update. This closes #1041.


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

Branch: refs/heads/ignite-comm-opts1
Commit: 9389328afdad8478b16f124f16cb45dde6c33aaf
Parents: 216477e
Author: tledkov-gridgain <tledkov@gridgain.com>
Authored: Wed Sep 7 17:35:45 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Sep 7 17:35:45 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/igfs/IgfsImpl.java      | 52 +++++++++++++-------
 1 file changed, 33 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9389328a/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 439e9ba..27618be 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
@@ -628,36 +628,50 @@ public final class IgfsImpl implements IgfsEx {
 
                 IgfsMode mode = resolveMode(path);
 
-                if (mode != PRIMARY) {
-                    assert IgfsUtils.isDualMode(mode);
+                switch (mode) {
+                    case PRIMARY:
+                    {
+                        List<IgniteUuid> fileIds = meta.idsForPath(path);
 
-                    await(path);
+                        IgniteUuid fileId = fileIds.get(fileIds.size() - 1);
 
-                    IgfsEntryInfo info = meta.updateDual(secondaryFs, path, props);
+                        if (fileId != null) {
+                            IgfsEntryInfo info = meta.updateProperties(fileId, props);
 
-                    if (info == null)
-                        return null;
+                            if (info != null) {
+                                if (evts.isRecordable(EVT_IGFS_META_UPDATED))
+                                    evts.record(new IgfsEvent(path, localNode(), EVT_IGFS_META_UPDATED,
props));
 
-                    return new IgfsFileImpl(path, info, data.groupBlockSize());
-                }
+                                return new IgfsFileImpl(path, info, data.groupBlockSize());
+                            }
+                        }
 
-                List<IgniteUuid> fileIds = meta.idsForPath(path);
+                        break;
+                    }
 
-                IgniteUuid fileId = fileIds.get(fileIds.size() - 1);
+                    case DUAL_ASYNC:
+                    case DUAL_SYNC:
+                    {
+                        await(path);
 
-                if (fileId == null)
-                    return null;
+                        IgfsEntryInfo info = meta.updateDual(secondaryFs, path, props);
 
-                IgfsEntryInfo info = meta.updateProperties(fileId, props);
+                        if (info != null)
+                            return new IgfsFileImpl(path, info, data.groupBlockSize());
 
-                if (info != null) {
-                    if (evts.isRecordable(EVT_IGFS_META_UPDATED))
-                        evts.record(new IgfsEvent(path, localNode(), EVT_IGFS_META_UPDATED,
props));
+                        break;
+                    }
+
+                    default:
+                        assert mode == PROXY : "Unknown mode: " + mode;
 
-                    return new IgfsFileImpl(path, info, data.groupBlockSize());
+                        IgfsFile file = secondaryFs.update(path, props);
+
+                        if (file != null)
+                            return new IgfsFileImpl(secondaryFs.update(path, props), data.groupBlockSize());
                 }
-                else
-                    return null;
+
+                return null;
             }
         });
     }


Mime
View raw message