You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/30 13:05:58 UTC

[1/5] incubator-ignite git commit: Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1058

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-gg-10298 fac08fae9 -> 39f6928de


Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1058


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

Branch: refs/heads/ignite-gg-10298
Commit: 4d731ea9a514d9a868e39732fc8094c0ed04548b
Parents: 29fe50c bade9f1
Author: iveselovskiy <iv...@gridgain.com>
Authored: Tue Jun 30 11:34:34 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Tue Jun 30 11:34:34 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheDeploymentManager.java       | 10 ++--
 .../shmem/IpcSharedMemoryServerEndpoint.java    | 10 +++-
 .../core/src/test/config/spark/spark-config.xml | 46 ++++++++++++++++++
 .../ignite/schema/model/PojoDescriptor.java     |  2 +
 .../apache/ignite/schema/model/PojoField.java   |  1 +
 .../parser/dialect/OracleMetadataDialect.java   |  2 +-
 .../org/apache/ignite/spark/IgniteContext.scala | 50 ++++++++++++++++++--
 .../org/apache/ignite/spark/IgniteRddSpec.scala | 18 +++++++
 8 files changed, 127 insertions(+), 12 deletions(-)
----------------------------------------------------------------------



[4/5] incubator-ignite git commit: Merge branch 'ignite-1058' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10298

Posted by sb...@apache.org.
Merge branch 'ignite-1058' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10298


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

Branch: refs/heads/ignite-gg-10298
Commit: 671fb6846cb4abfa6ff211eaa112394189c7814b
Parents: 614c8a1 9c6ff39
Author: iveselovskiy <iv...@gridgain.com>
Authored: Tue Jun 30 12:45:27 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Tue Jun 30 12:45:27 2015 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   | 25 +++++++++-----------
 .../communication/IoPoolExtension.java          |  9 ++++---
 2 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------



[3/5] incubator-ignite git commit: IGNITE-1058: Review.

Posted by sb...@apache.org.
IGNITE-1058: Review.


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

Branch: refs/heads/ignite-gg-10298
Commit: 9c6ff399f2b215f134b31607ddedc18a7637456b
Parents: 4d731ea
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Jun 30 12:24:17 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Jun 30 12:24:17 2015 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   | 25 +++++++++-----------
 .../communication/IoPoolExtension.java          |  9 ++++---
 2 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9c6ff399/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 4d422c6..a58cf73 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -69,6 +69,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
     private final Collection<GridDisconnectListener> disconnectLsnrs = new ConcurrentLinkedQueue<>();
 
     /** Map of {@link IoPoolExtension}-s injected by Ignite plugins. */
+    // TODO: This should not be concurrent map. Either HashMap or array.
     private final ConcurrentMap<Byte, IoPoolExtension> ioPoolExtensionMap = new ConcurrentHashMap8<>(128);
 
     /** Public pool. */
@@ -279,30 +280,20 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
 
                 // 1. Check the pool id is non-negative:
                 if (id < 0)
-                    throw new IgniteCheckedException("Failed to register IO executor pool because its Id is negative." +
+                    throw new IgniteCheckedException("Failed to register IO executor pool because its Id is negative " +
                         "[id=" + id + ", pluginId=" + ex.pligunId() + ']');
 
                 // 2. Check the pool id is in allowed range:
                 if (isReservedGridIoPolicy(id))
-                    throw new IgniteCheckedException("Failed to register IO executor pool because its Id in in the reserved" +
-                        " range. [id=" + id + ", pluginId="
-                            + ex.pligunId() + ']');
+                    throw new IgniteCheckedException("Failed to register IO executor pool because its Id in in the " +
+                        "reserved range (0-31) [id=" + id + ", pluginId=" + ex.pligunId() + ']');
 
                 // 3. Check the pool for duplicates:
                 IoPoolExtension pushedOut = ioPoolExtensionMap.putIfAbsent(id, ex);
                 if (pushedOut != null)
                     throw new IgniteCheckedException("Failed to register IO executor pool because its " +
-                        "Id as already used. [id=" + ex.id() + ", pluginId="
+                        "Id as already used [id=" + ex.id() + ", pluginId="
                         + ex.pligunId() + ", existingPoolPluginId=" + pushedOut.pligunId() + ']');
-
-                // 4. Check the pool has the executor:
-                Executor e = ex.executor();
-
-                if (e == null) {
-                    throw new IgniteCheckedException("Failed to register IO executor pool because its " +
-                        " executor is null. [id=" + id + ", pluginId="
-                        + ex.pligunId() + ']');
-                }
             }
         }
     }
@@ -595,10 +586,14 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                 }
 
                 default:
+                    // TODO: Assert.
                     if (plc < 0)
                         throw new IgniteException("Failed to process message with negative policy. [policy="
                             + plc + ']');
 
+                    // TODO: If from reserved range - ignore.
+                    // TODO: If from not-reserved range and IoExtension exists - process.
+                    // TODO: If from not-reserved range and IoExtension doesnt exist - ignore.
                     if (isReservedGridIoPolicy(plc))
                         throw new IgniteException("Failed to process message with policy of reserved range. [policy="
                             + plc + ']');
@@ -653,12 +648,14 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
 
                 IoPoolExtension pool = ioPoolExtensionMap.get(plc);
 
+                // TODO: Assert
                 if (pool == null)
                     throw new IgniteException("Failed to process message because corresponding executor pool is not "
                         + " found. [id=" + plc + ']');
 
                 assert plc == pool.id();
 
+                // TODO: Check for null and throw IgniteCheckedException.
                 return pool.executor();
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9c6ff399/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java
index 2f02f01..f452bfd 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java
@@ -24,21 +24,24 @@ import java.util.concurrent.*;
 /**
  * The interface of IO Messaging Pool Extension.
  */
+// TODO: IoPoolExtension -> IoPool
 public interface IoPoolExtension extends Extension {
     /**
-     * Gets the numeric identifier of the Pool.
-     * This identifier is to be taken from serialized
+     * Gets the numeric identifier of the pool. This identifier is to be taken from serialized
      * message and used to find the appropriate executor pool to process it.
+     *
      * @return The id.
      */
     public byte id();
 
     /**
-     * Gets the Executor for this Pool. Must always return the same Executor instance.
+     * Gets the Executor for this Pool. Cannot be null.
+     *
      * @return The executor.
      */
     public Executor executor();
 
+    // TODO: Remove.
     /**
      * Gets the Id of the plugin that injected this executor pool.
      * @return The plugin Id.


[5/5] incubator-ignite git commit: #[GG-10298]: corrected after review.

Posted by sb...@apache.org.
#[GG-10298]: corrected after review.


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

Branch: refs/heads/ignite-gg-10298
Commit: 39f6928defd2050aca05effaa590eedf628fddc8
Parents: 671fb68
Author: iveselovskiy <iv...@gridgain.com>
Authored: Tue Jun 30 14:04:42 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Tue Jun 30 14:04:42 2015 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   | 70 ++++++++++----------
 .../plugin/extensions/communication/IoPool.java | 42 ++++++++++++
 .../communication/IoPoolExtension.java          | 50 --------------
 3 files changed, 78 insertions(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/39f6928d/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index a58cf73..b79c8b8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -68,9 +68,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
     /** Disconnect listeners. */
     private final Collection<GridDisconnectListener> disconnectLsnrs = new ConcurrentLinkedQueue<>();
 
-    /** Map of {@link IoPoolExtension}-s injected by Ignite plugins. */
-    // TODO: This should not be concurrent map. Either HashMap or array.
-    private final ConcurrentMap<Byte, IoPoolExtension> ioPoolExtensionMap = new ConcurrentHashMap8<>(128);
+    /** Map of {@link IoPool}-s injected by Ignite plugins. */
+    private final IoPool[] ioPools = new IoPool[128];
 
     /** Public pool. */
     private ExecutorService pubPool;
@@ -270,30 +269,30 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
      */
     private void registerIoPoolExtensions() throws IgniteCheckedException {
         // Process custom IO messaging pool extensions:
-        final IoPoolExtension[] executorExtensions
-            = ctx.plugins().extensions(IoPoolExtension.class);
+        final IoPool[] executorExtensions
+            = ctx.plugins().extensions(IoPool.class);
 
         if (executorExtensions != null) {
             // Store it into the map and check for duplicates:
-            for (IoPoolExtension ex : executorExtensions) {
+            for (IoPool ex : executorExtensions) {
                 final byte id = ex.id();
 
                 // 1. Check the pool id is non-negative:
                 if (id < 0)
                     throw new IgniteCheckedException("Failed to register IO executor pool because its Id is negative " +
-                        "[id=" + id + ", pluginId=" + ex.pligunId() + ']');
+                        "[id=" + id + ']');
 
                 // 2. Check the pool id is in allowed range:
                 if (isReservedGridIoPolicy(id))
                     throw new IgniteCheckedException("Failed to register IO executor pool because its Id in in the " +
-                        "reserved range (0-31) [id=" + id + ", pluginId=" + ex.pligunId() + ']');
+                        "reserved range (0-31) [id=" + id + ']');
 
                 // 3. Check the pool for duplicates:
-                IoPoolExtension pushedOut = ioPoolExtensionMap.putIfAbsent(id, ex);
-                if (pushedOut != null)
+                if (ioPools[id] != null)
                     throw new IgniteCheckedException("Failed to register IO executor pool because its " +
-                        "Id as already used [id=" + ex.id() + ", pluginId="
-                        + ex.pligunId() + ", existingPoolPluginId=" + pushedOut.pligunId() + ']');
+                        "Id as already used [id=" + id + ']');
+
+                ioPools[id] = ex;
             }
         }
     }
@@ -493,7 +492,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         if (log.isDebugEnabled())
             log.debug(stopInfo());
 
-        ioPoolExtensionMap.clear();
+        Arrays.fill(ioPools, null);
     }
 
     /**
@@ -586,17 +585,11 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                 }
 
                 default:
-                    // TODO: Assert.
-                    if (plc < 0)
-                        throw new IgniteException("Failed to process message with negative policy. [policy="
-                            + plc + ']');
-
-                    // TODO: If from reserved range - ignore.
-                    // TODO: If from not-reserved range and IoExtension exists - process.
-                    // TODO: If from not-reserved range and IoExtension doesnt exist - ignore.
+                    assert plc >= 0 : "Negative policy: " + plc;
+
                     if (isReservedGridIoPolicy(plc))
-                        throw new IgniteException("Failed to process message with policy of reserved range. [policy="
-                            + plc + ']');
+                        throw new IgniteCheckedException("Failed to process message with policy of reserved range. " +
+                            "[policy=" + plc + ']');
 
                     if (msg.isOrdered())
                         processOrderedMessage(nodeId, msg, plc, msgC);
@@ -618,7 +611,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
      * @param plc Policy.
      * @return Execution pool.
      */
-    private Executor pool(byte plc) {
+    private Executor pool(byte plc) throws IgniteCheckedException {
         switch (plc) {
             case P2P_POOL:
                 return p2pPool;
@@ -642,21 +635,27 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                 return marshCachePool;
 
             default: {
+                assert plc >= 0 : "Negative policy: " + plc;
+
                 if (isReservedGridIoPolicy(plc))
-                    throw new IgniteException("Failed to process message with policy of reserved range, [policy="
-                        + plc + ']');
+                    throw new IgniteCheckedException("Failed to process message with policy of reserved" +
+                        " range (0-31), [policy=" + plc + ']');
 
-                IoPoolExtension pool = ioPoolExtensionMap.get(plc);
+                IoPool pool = ioPools[plc];
 
-                // TODO: Assert
                 if (pool == null)
-                    throw new IgniteException("Failed to process message because corresponding executor pool is not "
-                        + " found. [id=" + plc + ']');
+                    throw new IgniteCheckedException("Failed to process message because no pool is registered " +
+                        "for policy. [policy=" + plc + ']');
 
                 assert plc == pool.id();
 
-                // TODO: Check for null and throw IgniteCheckedException.
-                return pool.executor();
+                Executor ex = pool.executor();
+
+                if (ex == null)
+                    throw new IgniteCheckedException("Failed to process message because corresponding executor " +
+                        "is null. [id=" + plc + ']');
+
+                return ex;
             }
         }
     }
@@ -718,7 +717,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         final GridIoMessage msg,
         byte plc,
         final IgniteRunnable msgC
-    ) {
+    ) throws IgniteCheckedException {
         Runnable c = new Runnable() {
             @Override public void run() {
                 try {
@@ -776,7 +775,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         final GridIoMessage msg,
         final byte plc,
         @Nullable final IgniteRunnable msgC
-    ) {
+    ) throws IgniteCheckedException {
         assert msg != null;
 
         long timeout = msg.timeout();
@@ -1451,6 +1450,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                 for (GridCommunicationMessageSet msgSet : msgSets)
                     unwindMessageSet(msgSet, lsnr);
             }
+            catch (IgniteCheckedException ice) {
+                throw new IgniteException(ice);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/39f6928d/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPool.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPool.java b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPool.java
new file mode 100644
index 0000000..e87b82c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPool.java
@@ -0,0 +1,42 @@
+/*
+ * 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.plugin.extensions.communication;
+
+import org.apache.ignite.plugin.*;
+
+import java.util.concurrent.*;
+
+/**
+ * The interface of IO Messaging Pool Extension.
+ */
+public interface IoPool extends Extension {
+    /**
+     * Gets the numeric identifier of the pool. This identifier is to be taken from serialized
+     * message and used to find the appropriate executor pool to process it.
+     *
+     * @return The id.
+     */
+    public byte id();
+
+    /**
+     * Gets the Executor for this Pool. Cannot be null.
+     *
+     * @return The executor.
+     */
+    public Executor executor();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/39f6928d/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java
deleted file mode 100644
index f452bfd..0000000
--- a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/IoPoolExtension.java
+++ /dev/null
@@ -1,50 +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.plugin.extensions.communication;
-
-import org.apache.ignite.plugin.*;
-
-import java.util.concurrent.*;
-
-/**
- * The interface of IO Messaging Pool Extension.
- */
-// TODO: IoPoolExtension -> IoPool
-public interface IoPoolExtension extends Extension {
-    /**
-     * Gets the numeric identifier of the pool. This identifier is to be taken from serialized
-     * message and used to find the appropriate executor pool to process it.
-     *
-     * @return The id.
-     */
-    public byte id();
-
-    /**
-     * Gets the Executor for this Pool. Cannot be null.
-     *
-     * @return The executor.
-     */
-    public Executor executor();
-
-    // TODO: Remove.
-    /**
-     * Gets the Id of the plugin that injected this executor pool.
-     * @return The plugin Id.
-     */
-    public String pligunId();
-}


[2/5] incubator-ignite git commit: Merge branch 'ignite-1059' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10298

Posted by sb...@apache.org.
Merge branch 'ignite-1059' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10298


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

Branch: refs/heads/ignite-gg-10298
Commit: 614c8a15d5faf04ff6d46eb43f00c0260774e679
Parents: fac08fa 4d731ea
Author: iveselovskiy <iv...@gridgain.com>
Authored: Tue Jun 30 11:46:18 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Tue Jun 30 11:46:18 2015 +0300

----------------------------------------------------------------------

----------------------------------------------------------------------