ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [36/50] incubator-ignite git commit: sprint-2 fix for ignite-301
Date Tue, 03 Mar 2015 02:31:51 GMT
sprint-2 fix for ignite-301


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

Branch: refs/heads/ignite-45
Commit: ea6a1c03c66c1f78a9d9f00f73f9483c32569858
Parents: c9f46c1
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Mon Mar 2 16:00:21 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Mon Mar 2 16:00:21 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/GridKernalContext.java      | 10 ++++-
 .../ignite/internal/GridKernalContextImpl.java  | 14 +++++-
 .../apache/ignite/internal/IgniteKernal.java    | 23 +++++-----
 .../processors/cluster/ClusterProcessor.java    | 46 ++++++++++++++++++++
 4 files changed, 78 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ea6a1c03/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..cb9ffa1 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
@@ -33,11 +33,12 @@ import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.clock.*;
 import org.apache.ignite.internal.processors.closure.*;
+import org.apache.ignite.internal.processors.cluster.*;
 import org.apache.ignite.internal.processors.continuous.*;
 import org.apache.ignite.internal.processors.dataload.*;
 import org.apache.ignite.internal.processors.datastructures.*;
-import org.apache.ignite.internal.processors.igfs.*;
 import org.apache.ignite.internal.processors.hadoop.*;
+import org.apache.ignite.internal.processors.igfs.*;
 import org.apache.ignite.internal.processors.job.*;
 import org.apache.ignite.internal.processors.jobmetrics.*;
 import org.apache.ignite.internal.processors.offheap.*;
@@ -508,4 +509,11 @@ public interface GridKernalContext extends Iterable<GridComponent>
{
      * @return Exception registry.
      */
     public IgniteExceptionRegistry exceptionRegistry();
+
+    /**
+     * Gets Cluster processor.
+     *
+     * @return Cluster processor.
+     */
+    public ClusterProcessor cluster();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ea6a1c03/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..756c16a 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
@@ -36,11 +36,12 @@ import org.apache.ignite.internal.processors.cache.dr.os.*;
 import org.apache.ignite.internal.processors.cache.serialization.*;
 import org.apache.ignite.internal.processors.clock.*;
 import org.apache.ignite.internal.processors.closure.*;
+import org.apache.ignite.internal.processors.cluster.*;
 import org.apache.ignite.internal.processors.continuous.*;
 import org.apache.ignite.internal.processors.dataload.*;
 import org.apache.ignite.internal.processors.datastructures.*;
-import org.apache.ignite.internal.processors.igfs.*;
 import org.apache.ignite.internal.processors.hadoop.*;
+import org.apache.ignite.internal.processors.igfs.*;
 import org.apache.ignite.internal.processors.job.*;
 import org.apache.ignite.internal.processors.jobmetrics.*;
 import org.apache.ignite.internal.processors.offheap.*;
@@ -245,6 +246,10 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
 
     /** */
     @GridToStringExclude
+    private ClusterProcessor 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 ClusterProcessor)
+            cluster = (ClusterProcessor)comp;
         else
             assert (comp instanceof GridPluginComponent) : "Unknown manager class: " + comp.getClass();
 
@@ -854,6 +861,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
     }
 
     /** {@inheritDoc} */
+    @Override public ClusterProcessor 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/ea6a1c03/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..f46d071 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
@@ -39,6 +39,7 @@ import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.clock.*;
 import org.apache.ignite.internal.processors.closure.*;
+import org.apache.ignite.internal.processors.cluster.*;
 import org.apache.ignite.internal.processors.continuous.*;
 import org.apache.ignite.internal.processors.dataload.*;
 import org.apache.ignite.internal.processors.datastructures.*;
@@ -182,10 +183,6 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
     @GridToStringExclude
     private boolean errOnStop;
 
-    /** Cluster. */
-    @GridToStringExclude
-    private IgniteClusterImpl cluster;
-
     /** Scheduler. */
     @GridToStringExclude
     private IgniteScheduler scheduler;
@@ -229,37 +226,37 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
     /** {@inheritDoc} */
     @Override public IgniteClusterEx cluster() {
-        return cluster;
+        return ctx.cluster().get();
     }
 
     /** {@inheritDoc} */
     @Override public ClusterNode localNode() {
-        return cluster.localNode();
+        return ctx.cluster().get().localNode();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteCompute compute() {
-        return cluster.compute();
+        return ctx.cluster().get().compute();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteMessaging message() {
-        return cluster.message();
+        return ctx.cluster().get().message();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteEvents events() {
-        return cluster.events();
+        return ctx.cluster().get().events();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteServices services() {
-        return cluster.services();
+        return ctx.cluster().get().services();
     }
 
     /** {@inheritDoc} */
     @Override public ExecutorService executorService() {
-        return cluster.executorService();
+        return ctx.cluster().get().executorService();
     }
 
     /** {@inheritDoc} */
@@ -678,7 +675,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 igfsExecSvc,
                 restExecSvc);
 
-            cluster = new IgniteClusterImpl(ctx);
+            startProcessor(ctx, new ClusterProcessor(ctx), attrs);
 
             U.onGridStart();
 
@@ -1793,7 +1790,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 // No more kernal calls from this point on.
                 gw.setState(STOPPING);
 
-                cluster.clearNodeMap();
+                ctx.cluster().get().clearNodeMap();
 
                 if (log.isDebugEnabled())
                     log.debug("Grid " + (gridName == null ? "" : '\'' + gridName + "' ")
+ "is stopping.");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ea6a1c03/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
new file mode 100644
index 0000000..0ee00f1
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cluster;
+
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.cluster.*;
+import org.apache.ignite.internal.processors.*;
+
+/**
+ *
+ */
+public class ClusterProcessor extends GridProcessorAdapter {
+    /** */
+    private IgniteClusterImpl cluster;
+
+    /**
+     * @param ctx Kernal context.
+     */
+    public ClusterProcessor(GridKernalContext ctx) {
+        super(ctx);
+
+        cluster = new IgniteClusterImpl(ctx);
+    }
+
+    /**
+     * @return Cluster.
+     */
+    public IgniteClusterImpl get() {
+        return cluster;
+    }
+}


Mime
View raw message