ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [2/2] ignite git commit: IGNITE-1288: WIP.
Date Tue, 25 Aug 2015 07:13:03 GMT
IGNITE-1288: WIP.


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

Branch: refs/heads/ignite-1288
Commit: 440b874708e1f0084f80149d65a550639327b87d
Parents: 2afcd83
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Aug 25 10:11:13 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Aug 25 10:11:13 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/GridKernalContext.java      |  6 +++
 .../ignite/internal/GridKernalContextImpl.java  | 12 ++++++
 .../org/apache/ignite/internal/IgniteEx.java    |  1 +
 .../junits/multijvm/IgniteProcessProxy.java     |  1 +
 .../ignite/internal/platform/Platform.java      | 39 --------------------
 .../internal/platform/PlatformBootstrap.java    |  5 ++-
 .../internal/platform/PlatformIgnition.java     | 19 +++++-----
 7 files changed, 33 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/440b8747/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 f4da333..4e15a7a 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
@@ -43,6 +43,7 @@ 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.*;
+import org.apache.ignite.internal.processors.platform.*;
 import org.apache.ignite.internal.processors.plugin.*;
 import org.apache.ignite.internal.processors.port.*;
 import org.apache.ignite.internal.processors.query.*;
@@ -562,4 +563,9 @@ public interface GridKernalContext extends Iterable<GridComponent>
{
      * @return {@code True} if local node in disconnected state.
      */
     public boolean clientDisconnected();
+
+    /**
+     * @return Platform processor.
+     */
+    public PlatformProcessor platform();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/440b8747/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 fd8b50c..b2f91c9 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
@@ -44,6 +44,7 @@ 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.*;
+import org.apache.ignite.internal.processors.platform.*;
 import org.apache.ignite.internal.processors.plugin.*;
 import org.apache.ignite.internal.processors.port.*;
 import org.apache.ignite.internal.processors.query.*;
@@ -235,6 +236,10 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
 
     /** */
     @GridToStringExclude
+    private PlatformProcessor platformProc;
+
+    /** */
+    @GridToStringExclude
     private IgniteSpringHelper spring;
 
     /** */
@@ -485,6 +490,8 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
             dataStructuresProc = (DataStructuresProcessor)comp;
         else if (comp instanceof ClusterProcessor)
             cluster = (ClusterProcessor)comp;
+        else if (comp instanceof PlatformProcessor)
+            platformProc = (PlatformProcessor)comp;
         else if (!(comp instanceof DiscoveryNodeValidationProcessor))
             assert (comp instanceof GridPluginComponent) : "Unknown manager class: " + comp.getClass();
 
@@ -924,6 +931,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
         return locNode != null ? (locNode.isClient() && disconnected) : false;
     }
 
+    /** {@inheritDoc} */
+    @Override public PlatformProcessor platform() {
+        return platformProc;
+    }
+
     /**
      * @param disconnected Disconnected flag.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/440b8747/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java
index 4845d51..ef733cf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.hadoop.*;
+import org.apache.ignite.internal.processors.platform.*;
 import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/440b8747/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
index 220424a..c353762 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.hadoop.*;
+import org.apache.ignite.internal.processors.platform.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.typedef.*;

http://git-wip-us.apache.org/repos/asf/ignite/blob/440b8747/modules/platform/src/main/java/org/apache/ignite/internal/platform/Platform.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/platform/Platform.java
b/modules/platform/src/main/java/org/apache/ignite/internal/platform/Platform.java
deleted file mode 100644
index 6306723..0000000
--- a/modules/platform/src/main/java/org/apache/ignite/internal/platform/Platform.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.platform;
-
-import org.apache.ignite.*;
-
-/**
- * Platform entry point.
- */
-public interface Platform {
-    /**
-     * Get owning Ignite instance.
-     *
-     * @return Ignite instance.
-     */
-    public Ignite ignite();
-
-    /**
-     * Get environment pointer associated with this processor.
-     *
-     * @return Environment pointer.
-     */
-    public long environmentPointer();
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/440b8747/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformBootstrap.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformBootstrap.java
b/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformBootstrap.java
index 1044445..faee665 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformBootstrap.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformBootstrap.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.platform;
 
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.platform.*;
 
 /**
  * Platform bootstrap. Responsible for starting Ignite node with non-Java platform.
@@ -29,7 +30,7 @@ public interface PlatformBootstrap {
      * @param cfg Configuration.
      * @param envPtr Environment pointer.
      * @param dataPtr Optional pointer to additional data required for startup.
-     * @return Ignite node.
+     * @return Platform processor.
      */
-    public Platform start(IgniteConfiguration cfg, long envPtr, long dataPtr);
+    public PlatformProcessor start(IgniteConfiguration cfg, long envPtr, long dataPtr);
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/440b8747/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformIgnition.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformIgnition.java
b/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformIgnition.java
index 685cded..2d31307 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformIgnition.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/platform/PlatformIgnition.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.platform;
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.platform.*;
 import org.apache.ignite.internal.processors.resource.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -35,7 +36,7 @@ import java.util.*;
 @SuppressWarnings("UnusedDeclaration")
 public class PlatformIgnition {
     /** Map with active instances. */
-    private static final HashMap<String, Platform> instances = new HashMap<>();
+    private static final HashMap<String, PlatformProcessor> instances = new HashMap<>();
 
     /**
      * Start Ignite node in platform mode.
@@ -47,14 +48,14 @@ public class PlatformIgnition {
      * @param dataPtr Optional pointer to additional data required for startup.
      * @return Ignite instance.
      */
-    public static synchronized Platform start(@Nullable String springCfgPath, @Nullable String
gridName,
+    public static synchronized PlatformProcessor start(@Nullable String springCfgPath, @Nullable
String gridName,
         int factoryId, long envPtr, long dataPtr) {
         if (envPtr <= 0)
             throw new IgniteException("Environment pointer must be positive.");
 
         ClassLoader oldClsLdr = Thread.currentThread().getContextClassLoader();
 
-        Thread.currentThread().setContextClassLoader(Platform.class.getClassLoader());
+        Thread.currentThread().setContextClassLoader(PlatformProcessor.class.getClassLoader());
 
         try {
             IgniteConfiguration cfg = configuration(springCfgPath);
@@ -66,9 +67,9 @@ public class PlatformIgnition {
 
             PlatformBootstrap bootstrap = bootstrap(factoryId);
 
-            Platform proc = bootstrap.start(cfg, envPtr, dataPtr);
+            PlatformProcessor proc = bootstrap.start(cfg, envPtr, dataPtr);
 
-            Platform old = instances.put(gridName, proc);
+            PlatformProcessor old = instances.put(gridName, proc);
 
             assert old == null;
 
@@ -85,7 +86,7 @@ public class PlatformIgnition {
      * @param gridName Grid name.
      * @return Instance or {@code null} if it doesn't exist (never started or stopped).
      */
-    @Nullable public static synchronized Platform instance(@Nullable String gridName) {
+    @Nullable public static synchronized PlatformProcessor instance(@Nullable String gridName)
{
         return instances.get(gridName);
     }
 
@@ -96,7 +97,7 @@ public class PlatformIgnition {
      * @return Environment pointer or {@code 0} in case grid with such name doesn't exist.
      */
     public static synchronized long environmentPointer(@Nullable String gridName) {
-        Platform proc = instance(gridName);
+        PlatformProcessor proc = instance(gridName);
 
         return proc != null ? proc.environmentPointer() : 0;
     }
@@ -110,7 +111,7 @@ public class PlatformIgnition {
      */
     public static synchronized boolean stop(@Nullable String gridName, boolean cancel) {
         if (Ignition.stop(gridName, cancel)) {
-            Platform old = instances.remove(gridName);
+            PlatformProcessor old = instances.remove(gridName);
 
             assert old != null;
 
@@ -126,7 +127,7 @@ public class PlatformIgnition {
      * @param cancel Cancel flag.
      */
     public static synchronized void stopAll(boolean cancel) {
-        for (Platform proc : instances.values())
+        for (PlatformProcessor proc : instances.values())
             Ignition.stop(proc.ignite().name(), cancel);
 
         instances.clear();


Mime
View raw message