ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [07/15] ignite git commit: IGNITE-3331 IGFS: Route client tasks to primary node when metadata co-location is enabled. This closes #921.
Date Mon, 15 Aug 2016 14:18:23 GMT
IGNITE-3331 IGFS: Route client tasks to primary node when metadata co-location is enabled.
This closes #921.


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

Branch: refs/heads/ignite-3161
Commit: ae54e36f27719f46d1d276f62a977c3f8d053b44
Parents: dc81069
Author: tledkov-gridgain <tledkov@gridgain.com>
Authored: Thu Aug 4 17:04:41 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Aug 15 12:31:06 2016 +0300

----------------------------------------------------------------------
 .../processors/igfs/IgfsMetaManager.java        | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ae54e36f/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 0d14a3a..d1151c5 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
@@ -248,7 +248,25 @@ public class IgfsMetaManager extends IgfsManager {
      */
     <T> T runClientTask(IgfsClientAbstractCallable<T> task) {
         try {
-            return clientCompute().call(task);
+            return runClientTask(IgfsUtils.ROOT_ID, task);
+        }
+        catch (ClusterTopologyException e) {
+            throw new IgfsException("Failed to execute operation because there are no IGFS
metadata nodes." , e);
+        }
+    }
+
+    /**
+     * Run client task.
+     *
+     * @param affinityFileId Affinity fileId.
+     * @param task Task.
+     * @return Result.
+     */
+    <T> T runClientTask(IgniteUuid affinityFileId, IgfsClientAbstractCallable<T>
task) {
+        try {
+            return (cfg.isColocateMetadata()) ?
+                clientCompute().affinityCall(cfg.getMetaCacheName(), affinityFileId, task)
:
+                clientCompute().call(task);
         }
         catch (ClusterTopologyException e) {
             throw new IgfsException("Failed to execute operation because there are no IGFS
metadata nodes." , e);


Mime
View raw message