ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [38/38] incubator-ignite git commit: # IGNITE-312 Remove temporary code.
Date Tue, 24 Feb 2015 09:39:58 GMT
# IGNITE-312 Remove temporary code.


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

Branch: refs/heads/ignite-312
Commit: b9466f0940601a64232bdfb6b771176949b41cb5
Parents: 71896e2
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Tue Feb 24 12:39:00 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Tue Feb 24 12:39:00 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 14 ++++-----
 .../processors/cache/GridCacheProcessor.java    | 33 --------------------
 2 files changed, 6 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9466f09/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 2a5ea49..a5d19c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -686,11 +686,6 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
             startProcessor(ctx, rsrcProc, attrs);
 
-            // Create GridDiscoveryManager first, because another processors can register
listeners on it.
-            GridDiscoveryManager discoveryMgr = new GridDiscoveryManager(ctx);
-
-            ctx.add(discoveryMgr);
-
             // Inject resources into lifecycle beans.
             if (!cfg.isDaemon() && cfg.getLifecycleBeans() != null) {
                 for (LifecycleBean bean : cfg.getLifecycleBeans()) {
@@ -778,9 +773,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 gw.setState(STARTED);
 
                 // Start discovery manager last to make sure that grid is fully initialized.
-                discoveryMgr.addSpiAttributes(attrs);
-                discoveryMgr.setNodeAttributes(attrs, VER);
-                discoveryMgr.start();
+                startManager(ctx, new GridDiscoveryManager(ctx), attrs);
             }
             finally {
                 gw.writeUnlock();
@@ -1397,6 +1390,11 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
         throws IgniteCheckedException {
         mgr.addSpiAttributes(attrs);
 
+        // Set all node attributes into discovery manager,
+        // so they can be distributed to all nodes.
+        if (mgr instanceof GridDiscoveryManager)
+            ((GridDiscoveryManager)mgr).setNodeAttributes(attrs, VER);
+
         // Add manager to registry before it starts to avoid
         // cases when manager is started but registry does not
         // have it yet.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9466f09/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index c4166c0..e99c706 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -46,7 +46,6 @@ import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.lang.*;
 import org.apache.ignite.lifecycle.*;
 import org.apache.ignite.spi.*;
 import org.jetbrains.annotations.*;
@@ -548,38 +547,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         if (ctx.config().isDaemon())
             return;
 
-        // todo temporary code, remove it.
-
-        ctx.discovery().addCustomEvantListener(new IgniteClosure<Object, Void>() {
-            @Override public Void apply(Object o) {
-                if (o instanceof String)
-                    System.out.println("Message received: " + o);
-
-                return null;
-            }
-        });
-
-        new Thread(new Runnable() {
-            @Override public void run() {
-                try {
-                    System.out.println("Local nodeId=" + ctx.localNodeId());
-
-                    for (int i = 0; i < 10; i++) {
-                        Thread.sleep(5000);
-
-                        String msg = "e" + i + " [" + ctx.localNodeId() + ']';
-
-                        System.out.println("Sent message: " + msg);
-
-                        ctx.discovery().sendCustomEvent(msg);
-                    }
-                }
-                catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-            }
-        }).start();
-
         DeploymentMode depMode = ctx.config().getDeploymentMode();
 
         if (!F.isEmpty(ctx.config().getCacheConfiguration())) {


Mime
View raw message