ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject incubator-ignite git commit: # IGNITE-301 Make IgniteClusterImpl a processor.
Date Sun, 01 Mar 2015 17:14:58 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-301 [created] c91fd9dcf


# IGNITE-301 Make IgniteClusterImpl a processor.


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

Branch: refs/heads/ignite-301
Commit: c91fd9dcf7f09b3159e0193778cd5ca87a68e0ee
Parents: 036bd71
Author: sevdokimov <sergey.evdokimov@jetbrains.com>
Authored: Sun Mar 1 20:14:46 2015 +0300
Committer: sevdokimov <sergey.evdokimov@jetbrains.com>
Committed: Sun Mar 1 20:14:46 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/GridKernalContext.java      |  8 +++
 .../ignite/internal/GridKernalContextImpl.java  | 12 +++++
 .../apache/ignite/internal/IgniteKernal.java    | 22 ++++----
 .../internal/cluster/IgniteClusterImpl.java     | 54 +++++++++++++++++++-
 4 files changed, 82 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c91fd9dc/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
index 100ad28..c342e59 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal;
 
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.managers.checkpoint.*;
 import org.apache.ignite.internal.managers.collision.*;
 import org.apache.ignite.internal.managers.communication.*;
@@ -508,4 +509,11 @@ public interface GridKernalContext extends Iterable<GridComponent>
{
      * @return Exception registry.
      */
     public IgniteExceptionRegistry exceptionRegistry();
+
+    /**
+     * Gets Cluster processor.
+     *
+     * @return Cluster processor.
+     */
+    public IgniteClusterImpl cluster();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c91fd9dc/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index 395ad52..e8c3e4f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal;
 
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.managers.checkpoint.*;
 import org.apache.ignite.internal.managers.collision.*;
 import org.apache.ignite.internal.managers.communication.*;
@@ -245,6 +246,10 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
 
     /** */
     @GridToStringExclude
+    private IgniteClusterImpl cluster;
+
+    /** */
+    @GridToStringExclude
     private DataStructuresProcessor dataStructuresProc;
 
     /** */
@@ -461,6 +466,8 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
             qryProc = (GridQueryProcessor)comp;
         else if (comp instanceof DataStructuresProcessor)
             dataStructuresProc = (DataStructuresProcessor)comp;
+        else if (comp instanceof IgniteClusterImpl)
+            cluster = (IgniteClusterImpl)comp;
         else
             assert (comp instanceof GridPluginComponent) : "Unknown manager class: " + comp.getClass();
 
@@ -854,6 +861,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
     }
 
     /** {@inheritDoc} */
+    @Override public IgniteClusterImpl cluster() {
+        return cluster;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(GridKernalContextImpl.class, this);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c91fd9dc/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 9c92edd..e3e0b0a 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
@@ -182,10 +182,6 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
     @GridToStringExclude
     private boolean errOnStop;
 
-    /** Cluster. */
-    @GridToStringExclude
-    private IgniteClusterImpl cluster;
-
     /** Scheduler. */
     @GridToStringExclude
     private IgniteScheduler scheduler;
@@ -229,37 +225,37 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
     /** {@inheritDoc} */
     @Override public IgniteClusterEx cluster() {
-        return cluster;
+        return ctx.cluster();
     }
 
     /** {@inheritDoc} */
     @Override public ClusterNode localNode() {
-        return cluster.localNode();
+        return ctx.cluster().localNode();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteCompute compute() {
-        return cluster.compute();
+        return ctx.cluster().compute();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteMessaging message() {
-        return cluster.message();
+        return ctx.cluster().message();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteEvents events() {
-        return cluster.events();
+        return ctx.cluster().events();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteServices services() {
-        return cluster.services();
+        return ctx.cluster().services();
     }
 
     /** {@inheritDoc} */
     @Override public ExecutorService executorService() {
-        return cluster.executorService();
+        return ctx.cluster().executorService();
     }
 
     /** {@inheritDoc} */
@@ -678,7 +674,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 igfsExecSvc,
                 restExecSvc);
 
-            cluster = new IgniteClusterImpl(ctx);
+            startProcessor(ctx, new IgniteClusterImpl(ctx), attrs);
 
             U.onGridStart();
 
@@ -1793,7 +1789,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 // No more kernal calls from this point on.
                 gw.setState(STOPPING);
 
-                cluster.clearNodeMap();
+                ctx.cluster().clearNodeMap();
 
                 if (log.isDebugEnabled())
                     log.debug("Grid " + (gridName == null ? "" : '\'' + gridName + "' ")
+ "is stopping.");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c91fd9dc/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
index c79fed8..45462a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.nodestart.*;
@@ -28,6 +29,7 @@ import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.*;
 import org.jetbrains.annotations.*;
 
 import java.io.*;
@@ -42,7 +44,7 @@ import static org.apache.ignite.internal.util.nodestart.IgniteNodeStartUtils.*;
 /**
  *
  */
-public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClusterEx, Externalizable
{
+public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClusterEx, GridProcessor
{
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -521,6 +523,56 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements
IgniteClus
     }
 
     /** {@inheritDoc} */
+    @Override public void addAttributes(Map<String, Object> attrs) throws IgniteCheckedException
{
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void start() throws IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void stop(boolean cancel) throws IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onKernalStart() throws IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onKernalStop(boolean cancel) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Object collectDiscoveryData(UUID nodeId) {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void printMemoryStats() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public IgniteSpiNodeValidationResult validateNode(ClusterNode node)
{
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoveryDataExchangeType discoveryDataType() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
     public String toString() {
         return "IgniteCluster [igniteName=" + ctx.gridName() + ']';
     }


Mime
View raw message