ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [05/10] ignite git commit: Wired up discovery listener.
Date Thu, 28 Jul 2016 11:05:47 GMT
Wired up discovery listener.


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

Branch: refs/heads/ignite-3553
Commit: 53063126f1349a49ec9f59fc2d1ffb1af8ca3448
Parents: b2c8972
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Jul 27 16:08:44 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Jul 27 16:08:44 2016 +0300

----------------------------------------------------------------------
 .../igfs/client/IgfsClientManager.java          | 24 +++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/53063126/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientManager.java
index c393bb9..49246ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientManager.java
@@ -18,6 +18,8 @@
 package org.apache.ignite.internal.processors.igfs.client;
 
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.events.DiscoveryEvent;
+import org.apache.ignite.events.Event;
 import org.apache.ignite.igfs.IgfsException;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.GridTopic;
@@ -87,7 +89,7 @@ public class IgfsClientManager extends IgfsManager {
     @Override protected void start0() throws IgniteCheckedException {
         ctx.io().addMessageListener(GridTopic.TOPIC_IGFS_CLI, msgLsnr);
 
-        ctx.event().addLocalEventListener(discoLsnr, EVT_NODE_FAILED, EVT_NODE_LEFT, EVT_NODE_METRICS_UPDATED);
+        ctx.event().addLocalEventListener(discoLsnr, EVT_NODE_FAILED, EVT_NODE_LEFT);
     }
 
     /** {@inheritDoc} */
@@ -335,4 +337,24 @@ public class IgfsClientManager extends IgfsManager {
                 U.error(log, "IGFS client message listener received unknown message: " +
msg);
         }
     }
+
+    /**
+     * Discovery listener.
+     */
+    private class DiscoveryListener implements GridLocalEventListener {
+        /** {@inheritDoc} */
+        @Override public void onEvent(Event evt) {
+            switch (evt.type()) {
+                case EVT_NODE_LEFT:
+                case EVT_NODE_FAILED:
+                    DiscoveryEvent evt0 = (DiscoveryEvent)evt;
+
+                    onNodeLeft(evt0.eventNode().id());
+
+                    break;
+
+                default:
+                    assert false : "Unknown event: " + evt;
+        }
+    }
 }


Mime
View raw message