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/05/25 20:50:34 UTC

[01/20] incubator-ignite git commit: Merge branches 'ignite-709_2' and 'ignite-sprint-5' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-709_2

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-23 a837fe1e3 -> 2b679829e


Merge branches 'ignite-709_2' and 'ignite-sprint-5' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-709_2


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

Branch: refs/heads/ignite-23
Commit: 5da1bd7f0df240656039465a02d94b7c05c34dee
Parents: f0b6b6e 02f3a12
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri May 22 14:40:48 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri May 22 14:40:48 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 16 +++-
 .../config/benchmark-client-mode.properties     | 89 ++++++++++++++++++++
 2 files changed, 101 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[15/20] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-709_2' into ignite-709_2

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-709_2' into ignite-709_2


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

Branch: refs/heads/ignite-23
Commit: 3251815f3394878ba675bf203ac759f2f325362a
Parents: 5da1bd7 97e6bd3
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon May 25 16:50:00 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon May 25 16:50:00 2015 +0300

----------------------------------------------------------------------
 .gitignore                                      |   3 +-
 dev-tools/slurp.sh                              |  74 +++++++++++
 dev-tools/src/main/groovy/jiraslurp.groovy      | 132 +++++++++++--------
 .../ClientAbstractConnectivitySelfTest.java     |  14 ++
 .../main/java/org/apache/ignite/Ignition.java   |   9 +-
 .../org/apache/ignite/cluster/ClusterNode.java  |   5 +-
 .../configuration/IgniteConfiguration.java      |   3 +-
 .../internal/GridEventConsumeHandler.java       |  81 +++++++++---
 .../org/apache/ignite/internal/IgnitionEx.java  |  19 ++-
 .../internal/interop/InteropException.java      |  71 ++++++++++
 .../interop/InteropNoCallbackException.java     |  50 +++++++
 .../discovery/CustomMessageWrapper.java         |   5 +
 .../discovery/DiscoveryCustomMessage.java       |   5 +
 .../discovery/GridDiscoveryManager.java         |  26 ++--
 .../cache/DynamicCacheChangeBatch.java          |   5 +
 .../continuous/CacheContinuousQueryManager.java |   2 +-
 .../continuous/AbstractContinuousMessage.java   |  54 ++++++++
 .../StartRoutineAckDiscoveryMessage.java        |  26 ++--
 .../StartRoutineDiscoveryMessage.java           |  27 ++--
 .../StopRoutineAckDiscoveryMessage.java         |  21 +--
 .../continuous/StopRoutineDiscoveryMessage.java |  23 +---
 .../ignite/internal/util/IgniteUtils.java       |   6 +-
 .../discovery/DiscoverySpiCustomMessage.java    |   5 +
 .../discovery/tcp/TcpClientDiscoverySpi.java    |  14 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  34 +++--
 .../TcpDiscoveryCustomEventMessage.java         |  31 ++++-
 .../internal/GridReleaseTypeSelfTest.java       |   2 +
 .../GridDiscoveryManagerAliveCacheSelfTest.java |  46 ++++---
 .../continuous/GridEventConsumeSelfTest.java    |   2 +-
 ...pClientDiscoveryMarshallerCheckSelfTest.java |   2 +
 .../tcp/TcpClientDiscoverySpiSelfTest.java      |  36 +++--
 .../tcp/TcpDiscoveryConcurrentStartTest.java    |   2 +
 .../tcp/TcpDiscoveryMultiThreadedTest.java      |   2 +
 .../processors/hadoop/v2/HadoopV2Context.java   |  10 +-
 .../testsuites/IgniteHadoopTestSuite.java       |   2 +-
 ...niteCacheP2pUnmarshallingQueryErrorTest.java |   3 +-
 36 files changed, 631 insertions(+), 221 deletions(-)
----------------------------------------------------------------------



[12/20] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-5' into ignite-709_2

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-5' into ignite-709_2


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

Branch: refs/heads/ignite-23
Commit: 0d883a9ae833d7662e186c784f8c25712249398b
Parents: 5cb0e66 050f429
Author: sevdokimov <se...@gridgain.com>
Authored: Mon May 25 13:52:57 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon May 25 13:52:57 2015 +0300

----------------------------------------------------------------------
 .gitignore                                      |   3 +-
 dev-tools/slurp.sh                              |  74 +++++++++++
 dev-tools/src/main/groovy/jiraslurp.groovy      | 132 +++++++++++--------
 .../ClientAbstractConnectivitySelfTest.java     |  14 ++
 .../internal/interop/InteropException.java      |  71 ++++++++++
 .../interop/InteropNoCallbackException.java     |  50 +++++++
 .../ignite/internal/util/IgniteUtils.java       |   6 +-
 .../processors/hadoop/v2/HadoopV2Context.java   |  10 +-
 .../testsuites/IgniteHadoopTestSuite.java       |   2 +-
 9 files changed, 295 insertions(+), 67 deletions(-)
----------------------------------------------------------------------



[20/20] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-709_2' into ignite-23

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-709_2' into ignite-23


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

Branch: refs/heads/ignite-23
Commit: 2b679829e59571f16b3eaffa1c6de1f67c4f0396
Parents: a837fe1 092e8c7
Author: sboikov <se...@inria.fr>
Authored: Mon May 25 21:50:04 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Mon May 25 21:50:04 2015 +0300

----------------------------------------------------------------------
 .gitignore                                      |   3 +-
 dev-tools/slurp.sh                              |  74 +++++++++++
 dev-tools/src/main/groovy/jiraslurp.groovy      | 132 +++++++++++--------
 .../ClientAbstractConnectivitySelfTest.java     |  14 ++
 .../main/java/org/apache/ignite/Ignition.java   |  17 ++-
 .../org/apache/ignite/cluster/ClusterNode.java  |  24 +++-
 .../configuration/IgniteConfiguration.java      |   4 +-
 .../internal/GridEventConsumeHandler.java       |  96 ++++++++++----
 .../apache/ignite/internal/IgniteKernal.java    |   6 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |  27 ++--
 .../internal/interop/InteropException.java      |  71 ++++++++++
 .../interop/InteropNoCallbackException.java     |  50 +++++++
 .../ignite/internal/util/IgniteUtils.java       |   6 +-
 .../discovery/tcp/TcpClientDiscoverySpi.java    |  88 +++++++++----
 .../tcp/TcpClientDiscoverySpiMBean.java         |   8 --
 .../internal/GridReleaseTypeSelfTest.java       |   2 +
 .../GridDiscoveryManagerAliveCacheSelfTest.java |   5 +-
 ...pClientDiscoveryMarshallerCheckSelfTest.java |   2 +
 .../tcp/TcpClientDiscoverySpiSelfTest.java      |   2 +
 .../tcp/TcpDiscoveryConcurrentStartTest.java    |   2 +
 .../tcp/TcpDiscoveryMultiThreadedTest.java      |   2 +
 .../processors/hadoop/v2/HadoopV2Context.java   |  10 +-
 .../testsuites/IgniteHadoopTestSuite.java       |   2 +-
 23 files changed, 502 insertions(+), 145 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b679829/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
----------------------------------------------------------------------


[09/20] incubator-ignite git commit: IGNITE-709 Bug fix avoid hang GridContinuousProcessor

Posted by sb...@apache.org.
IGNITE-709 Bug fix avoid hang GridContinuousProcessor


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

Branch: refs/heads/ignite-23
Commit: a154d2c9582c378b04121f535c3fa59b0499dbaa
Parents: 9480e8d
Author: sevdokimov <se...@jetbrains.com>
Authored: Mon May 25 09:42:59 2015 +0300
Committer: sevdokimov <se...@jetbrains.com>
Committed: Mon May 25 09:42:59 2015 +0300

----------------------------------------------------------------------
 .../continuous/GridContinuousProcessor.java     | 44 +++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a154d2c9/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index d67a45a..d5c2488 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -92,6 +92,8 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
     /** Number of retries using to send messages. */
     private int retryCnt = 3;
 
+    private ExecutorService sendNotificationThreadPool;
+
     /**
      * @param ctx Kernal context.
      */
@@ -109,6 +111,9 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
 
         marsh = ctx.config().getMarshaller();
 
+        sendNotificationThreadPool = new ThreadPoolExecutor(0, 1, 2000, TimeUnit.MILLISECONDS,
+            new LinkedBlockingQueue<Runnable>(), new IgniteThreadFactory(ctx.gridName(), "notification-sender"));
+
         ctx.event().addLocalEventListener(new GridLocalEventListener() {
             @SuppressWarnings({"fallthrough", "TooBroadScope"})
             @Override public void onEvent(Event evt) {
@@ -268,6 +273,8 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
 
         if (log.isDebugEnabled())
             log.debug("Continuous processor stopped.");
+
+        sendNotificationThreadPool.shutdownNow();
     }
 
     /** {@inheritDoc} */
@@ -578,7 +585,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
                 Collection<Object> toSnd = info.add(obj);
 
                 if (toSnd != null)
-                    sendNotification(nodeId, routineId, null, toSnd, orderedTopic, msg);
+                    sendNotificationAsync(nodeId, routineId, null, toSnd, orderedTopic, msg);
             }
         }
     }
@@ -609,6 +616,41 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
     }
 
     /**
+     * @param nodeId Node ID.
+     * @param routineId Routine ID.
+     * @param futId Future ID.
+     * @param toSnd Notification object to send.
+     * @param orderedTopic Topic for ordered notifications.
+     *      If {@code null}, non-ordered message will be sent.
+     * @throws IgniteCheckedException In case of error.
+     */
+    private void sendNotificationAsync(final UUID nodeId,
+        final UUID routineId,
+        @Nullable final IgniteUuid futId,
+        final Collection<Object> toSnd,
+        @Nullable final Object orderedTopic,
+        final boolean msg) {
+        assert nodeId != null;
+        assert routineId != null;
+        assert toSnd != null;
+        assert !toSnd.isEmpty();
+
+        sendNotificationThreadPool.execute(new Runnable() {
+            @Override public void run() {
+                try {
+                    sendWithRetries(nodeId,
+                        new GridContinuousMessage(MSG_EVT_NOTIFICATION, routineId, futId, toSnd, msg),
+                        orderedTopic);
+                }
+                catch (IgniteCheckedException e) {
+                    U.error(log, "Failed to send event notification to node: " + nodeId, e);
+                }
+            }
+        });
+
+    }
+
+    /**
      * @param node Sender.
      * @param req Start request.
      */


[02/20] incubator-ignite git commit: # Added interop checked exception.

Posted by sb...@apache.org.
# Added interop checked exception.


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

Branch: refs/heads/ignite-23
Commit: 0acdc3de22932f0bf1e12764812fd5fcad603f23
Parents: 02f3a12
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri May 22 15:34:31 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri May 22 15:34:31 2015 +0300

----------------------------------------------------------------------
 .../internal/interop/InteropException.java      | 65 ++++++++++++++++++++
 1 file changed, 65 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc3de/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java
new file mode 100644
index 0000000..095c650
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java
@@ -0,0 +1,65 @@
+/*
+ * 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.interop;
+
+import org.apache.ignite.*;
+import org.jetbrains.annotations.*;
+
+/**
+ * Interop checked exception.
+ */
+public class InteropException extends IgniteCheckedException {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Create empty exception.
+     */
+    public InteropException() {
+        // No-op.
+    }
+
+    /**
+     * Creates new exception with given error message.
+     *
+     * @param msg Error message.
+     */
+    public InteropException(String msg) {
+        super(msg);
+    }
+
+    /**
+     * Creates new grid exception with given throwable as a cause and
+     * source of error message.
+     *
+     * @param cause Non-null throwable cause.
+     */
+    public InteropException(Throwable cause) {
+        this(cause.getMessage(), cause);
+    }
+
+    /**
+     * Creates new exception with given error message and optional nested exception.
+     *
+     * @param msg Error message.
+     * @param cause Optional nested exception (can be {@code null}).
+     */
+    public InteropException(String msg, @Nullable Throwable cause) {
+        super(msg, cause);
+    }
+}


[17/20] incubator-ignite git commit: # IGNITE-709 Check filter.apply(evt) in system thread, not in the discovery worker thread.

Posted by sb...@apache.org.
# IGNITE-709 Check filter.apply(evt) in system thread, not in the discovery worker thread.


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

Branch: refs/heads/ignite-23
Commit: 3dd778209c9341a2ffabcced703e31b9a1ae8705
Parents: 8aad099
Author: sevdokimov <se...@gridgain.com>
Authored: Mon May 25 18:31:33 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon May 25 18:32:55 2015 +0300

----------------------------------------------------------------------
 .../internal/GridEventConsumeHandler.java       | 109 ++++++++++---------
 1 file changed, 56 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3dd77820/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
index 0bba809..bb8366a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
@@ -136,78 +136,81 @@ class GridEventConsumeHandler implements GridContinuousHandler {
 
             private boolean notificationInProgress;
 
-            @Override public void onEvent(final Event evt) {
-                if (filter == null || filter.apply(evt)) {
-                    if (loc) {
-                        if (!cb.apply(nodeId, evt))
-                            ctx.continuous().stopRoutine(routineId);
-                    }
-                    else {
-                        if (ctx.discovery().node(nodeId) == null)
-                            return;
+            @Override public void onEvent(Event evt) {
+                synchronized (notificationQueue) {
+                    notificationQueue.add(new T3<>(nodeId, routineId, evt));
 
-                        synchronized (notificationQueue) {
-                            notificationQueue.add(new T3<>(nodeId, routineId, evt));
+                    if (!notificationInProgress) {
+                        ctx.getSystemExecutorService().submit(new Runnable() {
+                            @Override public void run() {
+                                while (true) {
+                                    T3<UUID, UUID, Event> t3;
 
-                            if (!notificationInProgress) {
-                                ctx.getSystemExecutorService().submit(new Runnable() {
-                                    @Override public void run() {
-                                        while (true) {
-                                            T3<UUID, UUID, Event> t3;
+                                    synchronized (notificationQueue) {
+                                        t3 = notificationQueue.poll();
 
-                                            synchronized (notificationQueue) {
-                                                t3 = notificationQueue.poll();
+                                        if (t3 == null) {
+                                            notificationInProgress = false;
 
-                                                if (t3 == null) {
-                                                    notificationInProgress = false;
+                                            return;
+                                        }
+                                    }
 
-                                                    return;
-                                                }
-                                            }
+                                    try {
+                                        Event evt = t3.get3();
 
-                                            try {
-                                                Event evt = t3.get3();
+                                        if (filter != null && !filter.apply(evt))
+                                            continue;
 
-                                                EventWrapper wrapper = new EventWrapper(evt);
+                                        if (loc) {
+                                            if (!cb.apply(nodeId, evt)) {
+                                                ctx.continuous().stopRoutine(routineId);
 
-                                                if (evt instanceof CacheEvent) {
-                                                    String cacheName = ((CacheEvent)evt).cacheName();
+                                                return;
+                                            }
 
-                                                    ClusterNode node = ctx.discovery().node(t3.get1());
+                                            continue;
+                                        }
 
-                                                    if (node == null)
-                                                        continue;
+                                        ClusterNode node = ctx.discovery().node(t3.get1());
 
-                                                    if (ctx.config().isPeerClassLoadingEnabled()
-                                                        && ctx.discovery().cacheNode(node, cacheName)) {
-                                                        wrapper.p2pMarshal(ctx.config().getMarshaller());
+                                        if (node == null)
+                                            continue;
 
-                                                        wrapper.cacheName = cacheName;
+                                        EventWrapper wrapper = new EventWrapper(evt);
 
-                                                        GridCacheDeploymentManager depMgr =
-                                                            ctx.cache().internalCache(cacheName).context().deploy();
+                                        if (evt instanceof CacheEvent) {
+                                            String cacheName = ((CacheEvent)evt).cacheName();
 
-                                                        depMgr.prepare(wrapper);
-                                                    }
-                                                }
+                                            if (ctx.config().isPeerClassLoadingEnabled()
+                                                && ctx.discovery().cacheNode(node, cacheName)) {
+                                                wrapper.p2pMarshal(ctx.config().getMarshaller());
 
-                                                ctx.continuous().addNotification(t3.get1(), t3.get2(), wrapper, null,
-                                                    false, false);
-                                            }
-                                            catch (ClusterTopologyCheckedException ignored) {
-                                                // No-op.
-                                            }
-                                            catch (Throwable e) {
-                                                U.error(ctx.log(GridEventConsumeHandler.class),
-                                                    "Failed to send event notification to node: " + nodeId, e);
+                                                wrapper.cacheName = cacheName;
+
+                                                GridCacheDeploymentManager depMgr =
+                                                    ctx.cache().internalCache(cacheName).context().deploy();
+
+                                                depMgr.prepare(wrapper);
                                             }
                                         }
-                                    }
-                                });
 
-                                notificationInProgress = true;
+                                        ctx.continuous().addNotification(t3.get1(), t3.get2(), wrapper, null,
+                                            false, false);
+                                    }
+                                    catch (ClusterTopologyCheckedException
+                                        | IgniteInterruptedCheckedException ignored) {
+                                        // No-op.
+                                    }
+                                    catch (Throwable e) {
+                                        U.error(ctx.log(GridEventConsumeHandler.class),
+                                            "Failed to send event notification to node: " + nodeId, e);
+                                    }
+                                }
                             }
-                        }
+                        });
+
+                        notificationInProgress = true;
                     }
                 }
             }


[10/20] incubator-ignite git commit: # IGNITE-709 Revert: Bug fix avoid hang GridContinuousProcessor

Posted by sb...@apache.org.
# IGNITE-709 Revert: Bug fix avoid hang GridContinuousProcessor


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

Branch: refs/heads/ignite-23
Commit: d411238ea00b406256e7314c336f2879be31a896
Parents: a154d2c
Author: sevdokimov <se...@gridgain.com>
Authored: Mon May 25 11:46:12 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon May 25 11:46:12 2015 +0300

----------------------------------------------------------------------
 .../continuous/GridContinuousProcessor.java     | 44 +-------------------
 1 file changed, 1 insertion(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d411238e/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index d5c2488..d67a45a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -92,8 +92,6 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
     /** Number of retries using to send messages. */
     private int retryCnt = 3;
 
-    private ExecutorService sendNotificationThreadPool;
-
     /**
      * @param ctx Kernal context.
      */
@@ -111,9 +109,6 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
 
         marsh = ctx.config().getMarshaller();
 
-        sendNotificationThreadPool = new ThreadPoolExecutor(0, 1, 2000, TimeUnit.MILLISECONDS,
-            new LinkedBlockingQueue<Runnable>(), new IgniteThreadFactory(ctx.gridName(), "notification-sender"));
-
         ctx.event().addLocalEventListener(new GridLocalEventListener() {
             @SuppressWarnings({"fallthrough", "TooBroadScope"})
             @Override public void onEvent(Event evt) {
@@ -273,8 +268,6 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
 
         if (log.isDebugEnabled())
             log.debug("Continuous processor stopped.");
-
-        sendNotificationThreadPool.shutdownNow();
     }
 
     /** {@inheritDoc} */
@@ -585,7 +578,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
                 Collection<Object> toSnd = info.add(obj);
 
                 if (toSnd != null)
-                    sendNotificationAsync(nodeId, routineId, null, toSnd, orderedTopic, msg);
+                    sendNotification(nodeId, routineId, null, toSnd, orderedTopic, msg);
             }
         }
     }
@@ -616,41 +609,6 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * @param nodeId Node ID.
-     * @param routineId Routine ID.
-     * @param futId Future ID.
-     * @param toSnd Notification object to send.
-     * @param orderedTopic Topic for ordered notifications.
-     *      If {@code null}, non-ordered message will be sent.
-     * @throws IgniteCheckedException In case of error.
-     */
-    private void sendNotificationAsync(final UUID nodeId,
-        final UUID routineId,
-        @Nullable final IgniteUuid futId,
-        final Collection<Object> toSnd,
-        @Nullable final Object orderedTopic,
-        final boolean msg) {
-        assert nodeId != null;
-        assert routineId != null;
-        assert toSnd != null;
-        assert !toSnd.isEmpty();
-
-        sendNotificationThreadPool.execute(new Runnable() {
-            @Override public void run() {
-                try {
-                    sendWithRetries(nodeId,
-                        new GridContinuousMessage(MSG_EVT_NOTIFICATION, routineId, futId, toSnd, msg),
-                        orderedTopic);
-                }
-                catch (IgniteCheckedException e) {
-                    U.error(log, "Failed to send event notification to node: " + nodeId, e);
-                }
-            }
-        });
-
-    }
-
-    /**
      * @param node Sender.
      * @param req Start request.
      */


[19/20] incubator-ignite git commit: # IGNITE-709 Add performance suggestion

Posted by sb...@apache.org.
# IGNITE-709 Add performance suggestion


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

Branch: refs/heads/ignite-23
Commit: 092e8c7d3fe6ce22b6a758a7db86224ddd0d22aa
Parents: b746fd2
Author: sevdokimov <se...@gridgain.com>
Authored: Mon May 25 19:03:57 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon May 25 19:03:57 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/internal/IgniteKernal.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/092e8c7d/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 a18318d..84d81d7 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
@@ -46,6 +46,7 @@ import org.apache.ignite.internal.processors.datastructures.*;
 import org.apache.ignite.internal.processors.hadoop.*;
 import org.apache.ignite.internal.processors.job.*;
 import org.apache.ignite.internal.processors.jobmetrics.*;
+import org.apache.ignite.internal.processors.nodevalidation.*;
 import org.apache.ignite.internal.processors.offheap.*;
 import org.apache.ignite.internal.processors.plugin.*;
 import org.apache.ignite.internal.processors.port.*;
@@ -56,7 +57,6 @@ import org.apache.ignite.internal.processors.security.*;
 import org.apache.ignite.internal.processors.segmentation.*;
 import org.apache.ignite.internal.processors.service.*;
 import org.apache.ignite.internal.processors.session.*;
-import org.apache.ignite.internal.processors.nodevalidation.*;
 import org.apache.ignite.internal.processors.task.*;
 import org.apache.ignite.internal.processors.timeout.*;
 import org.apache.ignite.internal.util.*;
@@ -71,6 +71,7 @@ import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.mxbean.*;
 import org.apache.ignite.plugin.*;
 import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.discovery.tcp.*;
 import org.jetbrains.annotations.*;
 
 import javax.management.*;
@@ -1072,6 +1073,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
         if (cfg.getIncludeEventTypes() != null && cfg.getIncludeEventTypes().length != 0)
             perf.add("Disable grid events (remove 'includeEventTypes' from configuration)");
 
+        if (Boolean.TRUE.equals(cfg.isClientMode()) && cfg.getDiscoverySpi() instanceof TcpDiscoverySpi)
+            perf.add("Use TcpClientDiscoverySpi instead of TcpDiscoverySpi to run client node");
+
         if (OptimizedMarshaller.available() && !(cfg.getMarshaller() instanceof OptimizedMarshaller))
             perf.add("Enable optimized marshaller (set 'marshaller' to " +
                 OptimizedMarshaller.class.getSimpleName() + ')');


[13/20] incubator-ignite git commit: # IGNITE-709 Add javadoc for client flag.

Posted by sb...@apache.org.
# IGNITE-709 Add javadoc for client flag.


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

Branch: refs/heads/ignite-23
Commit: 87fa310667805db68e568548ee50933132a81a58
Parents: 0d883a9
Author: sevdokimov <se...@gridgain.com>
Authored: Mon May 25 14:44:24 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon May 25 14:44:24 2015 +0300

----------------------------------------------------------------------
 modules/core/src/main/java/org/apache/ignite/Ignition.java  | 9 +++++++--
 .../main/java/org/apache/ignite/cluster/ClusterNode.java    | 5 ++++-
 .../apache/ignite/configuration/IgniteConfiguration.java    | 3 ++-
 3 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/87fa3106/modules/core/src/main/java/org/apache/ignite/Ignition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/Ignition.java b/modules/core/src/main/java/org/apache/ignite/Ignition.java
index 6ed99bd..af78c2a 100644
--- a/modules/core/src/main/java/org/apache/ignite/Ignition.java
+++ b/modules/core/src/main/java/org/apache/ignite/Ignition.java
@@ -133,18 +133,23 @@ public class Ignition {
     }
 
     /**
-     * Sets client mode flag.
+     * Sets static client mode flag. This flag used when node is started if {@link IgniteConfiguration#isClientMode()}
+     * is {@code null}.
      *
      * @param clientMode Client mode flag.
+     * @see IgniteConfiguration#isClientMode()
      */
     public static void setClientMode(boolean clientMode) {
         IgnitionEx.setClientMode(clientMode);
     }
 
     /**
-     * Gets client mode flag.
+     * Gets client static mode flag. This flag used when node is started if {@link IgniteConfiguration#isClientMode()}
+     * is {@code null}.
+     * {@link org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi} on client nodes.
      *
      * @return Client mode flag.
+     * @see IgniteConfiguration#isClientMode()
      */
     public static boolean isClientMode() {
         return IgnitionEx.isClientMode();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/87fa3106/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java b/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
index 9cb5d3d..5af4960 100644
--- a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
@@ -238,9 +238,12 @@ public interface ClusterNode {
     public boolean isDaemon();
 
     /**
-     * Tests whether or not this node is a client node.
+     * Tests whether or not this node is connected to cluster as a client. Do not confuse client in terms of
+     * discovery {@link org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi} and client in terms of cache
+     * {@link org.apache.ignite.configuration.IgniteConfiguration#isClientMode()}.
      *
      * @return {@code True} if this node is a client node, {@code false} otherwise.
+     * @see org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi
      */
     public boolean isClient();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/87fa3106/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index ebe2b8e..ac919cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -1823,7 +1823,8 @@ public class IgniteConfiguration {
     }
 
     /**
-     * Gets client mode flag.
+     * Gets client mode flag. Client node cannot hold data in the caches. It's recommended to use
+     * {@link org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi} on client nodes.
      *
      * @return Client mode flag.
      */


[16/20] incubator-ignite git commit: ignite-709 review

Posted by sb...@apache.org.
ignite-709 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/8aad0997
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8aad0997
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8aad0997

Branch: refs/heads/ignite-23
Commit: 8aad0997b229364a8a3d9d757653e1af43502964
Parents: 3251815
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon May 25 17:21:57 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon May 25 17:21:57 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/Ignition.java   | 18 +++++++++----
 .../org/apache/ignite/cluster/ClusterNode.java  | 27 ++++++++++++--------
 .../configuration/IgniteConfiguration.java      |  3 ++-
 .../org/apache/ignite/internal/IgnitionEx.java  | 12 +++------
 .../discovery/tcp/TcpClientDiscoverySpi.java    |  2 +-
 5 files changed, 37 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aad0997/modules/core/src/main/java/org/apache/ignite/Ignition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/Ignition.java b/modules/core/src/main/java/org/apache/ignite/Ignition.java
index af78c2a..3270f5c 100644
--- a/modules/core/src/main/java/org/apache/ignite/Ignition.java
+++ b/modules/core/src/main/java/org/apache/ignite/Ignition.java
@@ -20,6 +20,7 @@ package org.apache.ignite;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.discovery.tcp.*;
 import org.jetbrains.annotations.*;
 
 import java.io.*;
@@ -133,23 +134,30 @@ public class Ignition {
     }
 
     /**
-     * Sets static client mode flag. This flag used when node is started if {@link IgniteConfiguration#isClientMode()}
-     * is {@code null}.
+     * Sets client mode static flag.
+     * <p>
+     * This flag used when node is started if {@link IgniteConfiguration#isClientMode()}
+     * is {@code null}. When {@link IgniteConfiguration#isClientMode()} is set this flag is ignored.
+     * It is recommended to use {@link TcpClientDiscoverySpi} on client nodes.
      *
      * @param clientMode Client mode flag.
      * @see IgniteConfiguration#isClientMode()
+     * @see TcpClientDiscoverySpi
      */
     public static void setClientMode(boolean clientMode) {
         IgnitionEx.setClientMode(clientMode);
     }
 
     /**
-     * Gets client static mode flag. This flag used when node is started if {@link IgniteConfiguration#isClientMode()}
-     * is {@code null}.
-     * {@link org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi} on client nodes.
+     * Gets client mode static flag.
+     * <p>
+     * This flag used when node is started if {@link IgniteConfiguration#isClientMode()}
+     * is {@code null}. When {@link IgniteConfiguration#isClientMode()} is set this flag is ignored.
+     * It is recommended to use {@link TcpClientDiscoverySpi} on client nodes.
      *
      * @return Client mode flag.
      * @see IgniteConfiguration#isClientMode()
+     * @see TcpClientDiscoverySpi
      */
     public static boolean isClientMode() {
         return IgnitionEx.isClientMode();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aad0997/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java b/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
index 5af4960..13dc30a 100644
--- a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
@@ -18,7 +18,9 @@
 package org.apache.ignite.cluster;
 
 import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.discovery.tcp.*;
 import org.jetbrains.annotations.*;
 
 import java.util.*;
@@ -33,7 +35,7 @@ import java.util.*;
  * You can use cluster node attributes to provide static information about a node.
  * This information is initialized once within a cluster, during the node startup, and
  * remains the same throughout the lifetime of a node. Use
- * {@link org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} method to initialize your custom
+ * {@link IgniteConfiguration#getUserAttributes()} method to initialize your custom
  * node attributes at startup. Here is an example of how to assign an attribute to a node at startup:
  * <pre name="code" class="xml">
  * &lt;bean class="org.apache.ignite.configuration.IgniteConfiguration">
@@ -114,7 +116,7 @@ public interface ClusterNode {
 
     /**
      * Gets a node attribute. Attributes are assigned to nodes at startup
-     * via {@link org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} method.
+     * via {@link IgniteConfiguration#getUserAttributes()} method.
      * <p>
      * The system adds the following attributes automatically:
      * <ul>
@@ -149,7 +151,7 @@ public interface ClusterNode {
 
     /**
      * Gets all node attributes. Attributes are assigned to nodes at startup
-     * via {@link org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} method.
+     * via {@link IgniteConfiguration#getUserAttributes()} method.
      * <p>
      * The system adds the following attributes automatically:
      * <ul>
@@ -167,7 +169,7 @@ public interface ClusterNode {
     /**
      * Gets collection of addresses this node is known by.
      * <p>
-     * If {@link org.apache.ignite.configuration.IgniteConfiguration#getLocalHost()} value isn't {@code null} node will try to use that
+     * If {@link IgniteConfiguration#getLocalHost()} value isn't {@code null} node will try to use that
      * address for all communications and returned collection will contain only that address.
      * If it is {@code null} then local wildcard address will be used, and Ignite
      * will make the best effort to supply all addresses of that node in returned collection.
@@ -179,12 +181,12 @@ public interface ClusterNode {
     /**
      * Gets collection of host names this node is known by.
      * <p>
-     * If {@link org.apache.ignite.configuration.IgniteConfiguration#getLocalHost()} value isn't {@code null} node will try to use
+     * If {@link IgniteConfiguration#getLocalHost()} value isn't {@code null} node will try to use
      * the host name of that resolved address for all communications and
      * returned collection will contain only that host name.
      * If that host name can not be resolved then ip address returned by method {@link #addresses()} is used.
      * <p>
-     * If {@link org.apache.ignite.configuration.IgniteConfiguration#getLocalHost()} value is {@code null} then local wildcard address will be used,
+     * If {@link IgniteConfiguration#getLocalHost()} value is {@code null} then local wildcard address will be used,
      * and this method returns host names of all addresses of that node.
      *
      * @return Collection of host names.
@@ -238,12 +240,17 @@ public interface ClusterNode {
     public boolean isDaemon();
 
     /**
-     * Tests whether or not this node is connected to cluster as a client. Do not confuse client in terms of
-     * discovery {@link org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi} and client in terms of cache
-     * {@link org.apache.ignite.configuration.IgniteConfiguration#isClientMode()}.
+     * Tests whether or not this node is connected to cluster as a client.
+     * <p>
+     * Do not confuse client in terms of
+     * discovery {@link TcpClientDiscoverySpi} and client in terms of cache
+     * {@link IgniteConfiguration#isClientMode()}. Cache clients cannot carry data,
+     * while topology clients connect to topology in a different way.
      *
      * @return {@code True} if this node is a client node, {@code false} otherwise.
-     * @see org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi
+     * @see TcpClientDiscoverySpi
+     * @see IgniteConfiguration#isClientMode()
+     * @see Ignition#isClientMode()
      */
     public boolean isClient();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aad0997/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index ac919cc..e47d4b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -1824,9 +1824,10 @@ public class IgniteConfiguration {
 
     /**
      * Gets client mode flag. Client node cannot hold data in the caches. It's recommended to use
-     * {@link org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi} on client nodes.
+     * {@link TcpClientDiscoverySpi} on client nodes.
      *
      * @return Client mode flag.
+     * @see TcpClientDiscoverySpi
      */
     public Boolean isClientMode() {
         return clientMode;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aad0997/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 4f246e5..728fce6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -121,11 +121,7 @@ public class IgnitionEx {
     };
 
     /** */
-    private static ThreadLocal<Boolean> clientMode = new ThreadLocal<Boolean>() {
-        @Override protected Boolean initialValue() {
-            return null;
-        }
-    };
+    private static ThreadLocal<Boolean> clientMode = new ThreadLocal<>();
 
     /**
      * Checks runtime version to be 1.7.x or 1.8.x.
@@ -196,7 +192,7 @@ public class IgnitionEx {
      * @return Client mode flag.
      */
     public static boolean isClientMode() {
-        return clientMode.get();
+        return clientMode.get() == null ? false : clientMode.get();
     }
 
     /**
@@ -1749,8 +1745,8 @@ public class IgnitionEx {
 
             if (myCfg.isClientMode() == null || !myCfg.isClientMode()) {
                 if (myCfg.getDiscoverySpi() instanceof TcpClientDiscoverySpi) {
-                    throw new IgniteCheckedException("TcpClientDiscoverySpi can be used in client mode only, you " +
-                        "have to set IgniteConfiguration#isClientMode to 'true'");
+                    throw new IgniteCheckedException("TcpClientDiscoverySpi can be used in client mode only" +
+                        "(consider changing 'IgniteConfiguration.clientMode' to 'true').");
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aad0997/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
index 22bb49b..84e3493 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
@@ -47,7 +47,7 @@ import static org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHeartbeat
 /**
  * Client discovery SPI implementation that uses TCP/IP for node discovery.
  * <p>
- * This discovery SPI requires at least on server node configured with
+ * This discovery SPI requires at least one server node configured with
  * {@link TcpDiscoverySpi}. It will try to connect to random IP taken from
  * {@link TcpDiscoveryIpFinder} which should point to one of these server
  * nodes and will maintain connection only with this node (will not enter the ring).


[11/20] incubator-ignite git commit: IGNITE-709 Bug fix avoid hang GridContinuousProcessor

Posted by sb...@apache.org.
IGNITE-709 Bug fix avoid hang GridContinuousProcessor


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

Branch: refs/heads/ignite-23
Commit: 5cb0e6643ba82ec021e0bd8f1aaf0a65d28b8391
Parents: d411238
Author: sevdokimov <se...@gridgain.com>
Authored: Mon May 25 12:39:19 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon May 25 12:39:19 2015 +0300

----------------------------------------------------------------------
 .../internal/GridEventConsumeHandler.java       | 81 +++++++++++++++-----
 1 file changed, 61 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5cb0e664/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
index 505204d..0bba809 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
@@ -20,9 +20,9 @@ package org.apache.ignite.internal;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.events.*;
+import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.interop.*;
 import org.apache.ignite.internal.managers.deployment.*;
-import org.apache.ignite.internal.managers.discovery.*;
 import org.apache.ignite.internal.managers.eventstorage.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.continuous.*;
@@ -131,40 +131,81 @@ class GridEventConsumeHandler implements GridContinuousHandler {
         final boolean loc = nodeId.equals(ctx.localNodeId());
 
         lsnr = new GridLocalEventListener() {
-            @Override public void onEvent(Event evt) {
+            /** node ID, routine ID, event */
+            private final Queue<T3<UUID, UUID, Event>> notificationQueue = new LinkedList<>();
+
+            private boolean notificationInProgress;
+
+            @Override public void onEvent(final Event evt) {
                 if (filter == null || filter.apply(evt)) {
                     if (loc) {
                         if (!cb.apply(nodeId, evt))
                             ctx.continuous().stopRoutine(routineId);
                     }
                     else {
-                        GridDiscoveryManager disco = ctx.discovery();
+                        if (ctx.discovery().node(nodeId) == null)
+                            return;
+
+                        synchronized (notificationQueue) {
+                            notificationQueue.add(new T3<>(nodeId, routineId, evt));
+
+                            if (!notificationInProgress) {
+                                ctx.getSystemExecutorService().submit(new Runnable() {
+                                    @Override public void run() {
+                                        while (true) {
+                                            T3<UUID, UUID, Event> t3;
+
+                                            synchronized (notificationQueue) {
+                                                t3 = notificationQueue.poll();
+
+                                                if (t3 == null) {
+                                                    notificationInProgress = false;
 
-                        ClusterNode node = disco.node(nodeId);
+                                                    return;
+                                                }
+                                            }
 
-                        if (node != null) {
-                            try {
-                                EventWrapper wrapper = new EventWrapper(evt);
+                                            try {
+                                                Event evt = t3.get3();
 
-                                if (evt instanceof CacheEvent) {
-                                    String cacheName = ((CacheEvent)evt).cacheName();
+                                                EventWrapper wrapper = new EventWrapper(evt);
 
-                                    if (ctx.config().isPeerClassLoadingEnabled() && disco.cacheNode(node, cacheName)) {
-                                        wrapper.p2pMarshal(ctx.config().getMarshaller());
+                                                if (evt instanceof CacheEvent) {
+                                                    String cacheName = ((CacheEvent)evt).cacheName();
 
-                                        wrapper.cacheName = cacheName;
+                                                    ClusterNode node = ctx.discovery().node(t3.get1());
 
-                                        GridCacheDeploymentManager depMgr =
-                                            ctx.cache().internalCache(cacheName).context().deploy();
+                                                    if (node == null)
+                                                        continue;
 
-                                        depMgr.prepare(wrapper);
+                                                    if (ctx.config().isPeerClassLoadingEnabled()
+                                                        && ctx.discovery().cacheNode(node, cacheName)) {
+                                                        wrapper.p2pMarshal(ctx.config().getMarshaller());
+
+                                                        wrapper.cacheName = cacheName;
+
+                                                        GridCacheDeploymentManager depMgr =
+                                                            ctx.cache().internalCache(cacheName).context().deploy();
+
+                                                        depMgr.prepare(wrapper);
+                                                    }
+                                                }
+
+                                                ctx.continuous().addNotification(t3.get1(), t3.get2(), wrapper, null,
+                                                    false, false);
+                                            }
+                                            catch (ClusterTopologyCheckedException ignored) {
+                                                // No-op.
+                                            }
+                                            catch (Throwable e) {
+                                                U.error(ctx.log(GridEventConsumeHandler.class),
+                                                    "Failed to send event notification to node: " + nodeId, e);
+                                            }
+                                        }
                                     }
-                                }
+                                });
 
-                                ctx.continuous().addNotification(nodeId, routineId, wrapper, null, false, false);
-                            }
-                            catch (IgniteCheckedException e) {
-                                U.error(ctx.log(getClass()), "Failed to send event notification to node: " + nodeId, e);
+                                notificationInProgress = true;
                             }
                         }
                     }


[03/20] incubator-ignite git commit: # Fixed downloaded Hive version to repair the Hadoop tests.

Posted by sb...@apache.org.
# Fixed downloaded Hive version to repair the Hadoop tests.


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

Branch: refs/heads/ignite-23
Commit: b375aaa90f31dd3ef140e10f30343a5d8f8eed57
Parents: 0acdc3d
Author: iveselovskiy <iv...@gridgain.com>
Authored: Fri May 22 15:57:11 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Fri May 22 15:57:11 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b375aaa9/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index 183087c..179f7f0 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -129,7 +129,7 @@ public class IgniteHadoopTestSuite extends TestSuite {
      * @throws Exception If failed.
      */
     public static void downloadHive() throws Exception {
-        String ver = IgniteSystemProperties.getString("hive.version", "0.13.1");
+        String ver = IgniteSystemProperties.getString("hive.version", "1.2.0");
 
         X.println("Will use Hive version: " + ver);
 


[07/20] incubator-ignite git commit: # One more interop exception.

Posted by sb...@apache.org.
# One more interop exception.


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

Branch: refs/heads/ignite-23
Commit: 6ba171f2d60cf878bede42e27a4b0a0ee58948cd
Parents: 6093619
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri May 22 19:25:30 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri May 22 19:25:30 2015 +0300

----------------------------------------------------------------------
 .../internal/interop/InteropException.java      |  6 +++
 .../interop/InteropNoCallbackException.java     | 50 ++++++++++++++++++++
 2 files changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6ba171f2/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java
index 095c650..d74b9d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropException.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.interop;
 
 import org.apache.ignite.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
 
 /**
@@ -62,4 +63,9 @@ public class InteropException extends IgniteCheckedException {
     public InteropException(String msg, @Nullable Throwable cause) {
         super(msg, cause);
     }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(InteropException.class, this);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6ba171f2/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropNoCallbackException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropNoCallbackException.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropNoCallbackException.java
new file mode 100644
index 0000000..6fd614a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropNoCallbackException.java
@@ -0,0 +1,50 @@
+/*
+ * 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.interop;
+
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+/**
+ * Exception raised when interop callback is not set in native platform.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public class InteropNoCallbackException extends InteropException {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Constructor.
+     */
+    public InteropNoCallbackException() {
+        // No-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param msg Message.
+     */
+    public InteropNoCallbackException(String msg) {
+        super(msg);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(InteropNoCallbackException.class, this);
+    }
+}


[14/20] incubator-ignite git commit: # IGNITE-709 Create TcpClientDiscoverySpi automatically for nodes in client mode.

Posted by sb...@apache.org.
# IGNITE-709 Create TcpClientDiscoverySpi automatically for nodes in client mode.


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

Branch: refs/heads/ignite-23
Commit: 97e6bd341796a60a047571d3e3741219ccad67bd
Parents: 87fa310
Author: sevdokimov <se...@gridgain.com>
Authored: Mon May 25 15:12:25 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon May 25 15:12:25 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java   | 19 +++++++++++++++----
 .../ignite/internal/GridReleaseTypeSelfTest.java |  2 ++
 .../GridDiscoveryManagerAliveCacheSelfTest.java  |  5 ++++-
 ...cpClientDiscoveryMarshallerCheckSelfTest.java |  2 ++
 .../tcp/TcpClientDiscoverySpiSelfTest.java       |  2 ++
 .../tcp/TcpDiscoveryConcurrentStartTest.java     |  2 ++
 .../tcp/TcpDiscoveryMultiThreadedTest.java       |  2 ++
 7 files changed, 29 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/97e6bd34/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index abd55c6..4f246e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1747,6 +1747,13 @@ public class IgnitionEx {
                 myCfg.setFileSystemConfiguration(clone);
             }
 
+            if (myCfg.isClientMode() == null || !myCfg.isClientMode()) {
+                if (myCfg.getDiscoverySpi() instanceof TcpClientDiscoverySpi) {
+                    throw new IgniteCheckedException("TcpClientDiscoverySpi can be used in client mode only, you " +
+                        "have to set IgniteConfiguration#isClientMode to 'true'");
+                }
+            }
+
             initializeDefaultSpi(myCfg);
 
             initializeDefaultCacheConfiguration(myCfg);
@@ -1811,11 +1818,15 @@ public class IgnitionEx {
          * @param cfg Ignite configuration.
          */
         private void initializeDefaultSpi(IgniteConfiguration cfg) {
-            if (cfg.getDiscoverySpi() == null)
-                cfg.setDiscoverySpi(new TcpDiscoverySpi());
+            if (cfg.getDiscoverySpi() == null) {
+                if (cfg.isClientMode() != null && cfg.isClientMode())
+                    cfg.setDiscoverySpi(new TcpClientDiscoverySpi());
+                else
+                    cfg.setDiscoverySpi(new TcpDiscoverySpi());
+            }
 
-            if (cfg.getDiscoverySpi() instanceof TcpDiscoverySpi) {
-                TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)cfg.getDiscoverySpi();
+            if (cfg.getDiscoverySpi() instanceof TcpDiscoverySpiAdapter) {
+                TcpDiscoverySpiAdapter tcpDisco = (TcpDiscoverySpiAdapter)cfg.getDiscoverySpi();
 
                 if (tcpDisco.getIpFinder() == null)
                     tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/97e6bd34/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
index 4733ae5..b2374fb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
@@ -55,6 +55,8 @@ public class GridReleaseTypeSelfTest extends GridCommonAbstractTest {
                     attrs.put(IgniteNodeAttributes.ATTR_BUILD_VER, nodeVer);
                 }
             };
+
+            cfg.setClientMode(true);
         }
         else {
             discoSpi = new TcpDiscoverySpi() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/97e6bd34/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
index 55d4d80..0af90c1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
@@ -91,8 +91,11 @@ public class GridDiscoveryManagerAliveCacheSelfTest extends GridCommonAbstractTe
 
         TcpDiscoverySpiAdapter disc;
 
-        if (clientMode && ((gridName.charAt(gridName.length() - 1) - '0') & 1) != 0)
+        if (clientMode && ((gridName.charAt(gridName.length() - 1) - '0') & 1) != 0) {
             disc = new TcpClientDiscoverySpi();
+
+            cfg.setClientMode(true);
+        }
         else {
             TcpDiscoverySpi srvDisc = new TcpDiscoverySpi();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/97e6bd34/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoveryMarshallerCheckSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoveryMarshallerCheckSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoveryMarshallerCheckSelfTest.java
index ad61755..a2dee89 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoveryMarshallerCheckSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoveryMarshallerCheckSelfTest.java
@@ -47,6 +47,8 @@ public class TcpClientDiscoveryMarshallerCheckSelfTest extends GridCommonAbstrac
         else {
             discoSpi = new TcpClientDiscoverySpi();
 
+            cfg.setClientMode(true);
+
             cfg.setMarshaller(new OptimizedMarshaller());
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/97e6bd34/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
index 727d505..8157d59 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
@@ -118,6 +118,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
         else if (gridName.startsWith("client")) {
             disco = new TestTcpClientDiscovery();
 
+            cfg.setClientMode(true);
+
             TcpDiscoveryVmIpFinder ipFinder;
 
             if (clientIpFinder != null)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/97e6bd34/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryConcurrentStartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryConcurrentStartTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryConcurrentStartTest.java
index 67566a8..d8512e3 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryConcurrentStartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryConcurrentStartTest.java
@@ -52,6 +52,8 @@ public class TcpDiscoveryConcurrentStartTest extends GridCommonAbstractTest {
 
         cfg.setCacheConfiguration();
 
+        cfg.setClientMode(client);
+
         return cfg;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/97e6bd34/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
index a2d8276..6509a6d 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
@@ -75,6 +75,8 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest {
 
             spi.setIpFinder(ipFinder);
 
+            cfg.setClientMode(true);
+
             cfg.setDiscoverySpi(spi);
         }
         else {


[18/20] incubator-ignite git commit: # IGNITE-709 Add documentation for TcpClientDiscoverySpi, remove 'disconnectCheckInterval' property

Posted by sb...@apache.org.
# IGNITE-709 Add documentation for TcpClientDiscoverySpi, remove 'disconnectCheckInterval' property


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

Branch: refs/heads/ignite-23
Commit: b746fd25c6590e27080d3ba4bc62c3148ed8f364
Parents: 3dd7782
Author: sevdokimov <se...@gridgain.com>
Authored: Mon May 25 18:54:23 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Mon May 25 18:54:23 2015 +0300

----------------------------------------------------------------------
 .../discovery/tcp/TcpClientDiscoverySpi.java    | 86 +++++++++++++++-----
 .../tcp/TcpClientDiscoverySpiMBean.java         |  8 --
 2 files changed, 65 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b746fd25/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
index 84e3493..de954d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
@@ -53,15 +53,77 @@ import static org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHeartbeat
  * nodes and will maintain connection only with this node (will not enter the ring).
  * If this connection is broken, it will try to reconnect using addresses from
  * the same IP finder.
+ *
+ * <h1 class="header">Configuration</h1>
+ * <h2 class="header">Mandatory</h2>
+ * There are no mandatory configuration parameters.
+ * <h2 class="header">Optional</h2>
+ * The following configuration parameters are optional:
+ * <ul>
+ * <li>IP finder to share info about nodes IP addresses
+ * (see {@link #setIpFinder(TcpDiscoveryIpFinder)}).
+ * See the following IP finder implementations for details on configuration:
+ * <ul>
+ * <li>{@link org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder}</li>
+ * <li>{@ignitelink org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder}</li>
+ * <li>{@link org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc.TcpDiscoveryJdbcIpFinder}</li>
+ * <li>{@link org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder}</li>
+ * <li>{@link TcpDiscoveryMulticastIpFinder} - default</li>
+ * </ul>
+ * </li>
+ * </ul>
+ * <ul>
+ * <li>Local address (see {@link #setLocalAddress(String)})</li>
+ * <li>Heartbeat frequency (see {@link #setHeartbeatFrequency(long)})</li>
+ * <li>Network timeout (see {@link #setNetworkTimeout(long)})</li>
+ * <li>Socket timeout (see {@link #setSocketTimeout(long)})</li>
+ * <li>Message acknowledgement timeout (see {@link #setAckTimeout(long)})</li>
+ * <li>Join timeout (see {@link #setJoinTimeout(long)})</li>
+ * <li>Thread priority for threads started by SPI (see {@link #setThreadPriority(int)})</li>
+ * </ul>
+ * <h2 class="header">Java Example</h2>
+ * <pre name="code" class="java">
+ * TcpClientDiscoverySpi spi = new TcpClientDiscoverySpi();
+ *
+ * TcpDiscoveryVmIpFinder finder =
+ *     new GridTcpDiscoveryVmIpFinder();
+ *
+ * spi.setIpFinder(finder);
+ *
+ * IgniteConfiguration cfg = new IgniteConfiguration();
+ *
+ * // Override default discovery SPI.
+ * cfg.setDiscoverySpi(spi);
+ *
+ * // Start grid.
+ * Ignition.start(cfg);
+ * </pre>
+ * <h2 class="header">Spring Example</h2>
+ * TcpClientDiscoverySpi can be configured from Spring XML configuration file:
+ * <pre name="code" class="xml">
+ * &lt;bean id="grid.custom.cfg" class="org.apache.ignite.configuration.IgniteConfiguration" singleton="true"&gt;
+ *         ...
+ *         &lt;property name="discoverySpi"&gt;
+ *             &lt;bean class="org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi"&gt;
+ *                 &lt;property name="ipFinder"&gt;
+ *                     &lt;bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder" /&gt;
+ *                 &lt;/property&gt;
+ *             &lt;/bean&gt;
+ *         &lt;/property&gt;
+ *         ...
+ * &lt;/bean&gt;
+ * </pre>
+ * <p>
+ * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ * @see DiscoverySpi
  */
 @SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
 @IgniteSpiMultipleInstancesSupport(true)
 @DiscoverySpiOrderSupport(true)
 @DiscoverySpiHistorySupport(true)
 public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpClientDiscoverySpiMBean {
-    /** Default disconnect check interval. */
-    public static final long DFLT_DISCONNECT_CHECK_INT = 2000;
-
     /** Default socket operations timeout in milliseconds (value is <tt>700ms</tt>). */
     public static final long DFLT_SOCK_TIMEOUT = 700;
 
@@ -110,9 +172,6 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
     /** Left latch. */
     private final CountDownLatch leaveLatch = new CountDownLatch(1);
 
-    /** Disconnect check interval. */
-    private long disconnectCheckInt = DFLT_DISCONNECT_CHECK_INT;
-
     /** */
     private final Timer timer = new Timer("TcpClientDiscoverySpi.timer");
 
@@ -128,21 +187,6 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
     }
 
     /** {@inheritDoc} */
-    @Override public long getDisconnectCheckInterval() {
-        return disconnectCheckInt;
-    }
-
-    /**
-     * Sets disconnect check interval.
-     *
-     * @param disconnectCheckInt Disconnect check interval.
-     */
-    @IgniteSpiConfiguration(optional = true)
-    public void setDisconnectCheckInterval(long disconnectCheckInt) {
-        this.disconnectCheckInt = disconnectCheckInt;
-    }
-
-    /** {@inheritDoc} */
     @Override public long getSocketTimeout() {
         return sockTimeout;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b746fd25/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
index 9fe4adc..3101da8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
@@ -27,14 +27,6 @@ import java.util.*;
  */
 public interface TcpClientDiscoverySpiMBean extends IgniteSpiManagementMBean {
     /**
-     * Gets disconnect check interval.
-     *
-     * @return Disconnect check interval.
-     */
-    @MXBeanDescription("Disconnect check interval.")
-    public long getDisconnectCheckInterval();
-
-    /**
      * Gets socket timeout.
      *
      * @return Socket timeout.


[06/20] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5


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

Branch: refs/heads/ignite-23
Commit: 609361932fa02880a4555788c4820ca19d742a8a
Parents: a253533 c2734e4
Author: null <null>
Authored: Fri May 22 16:25:18 2015 +0300
Committer: null <null>
Committed: Fri May 22 16:25:18 2015 +0300

----------------------------------------------------------------------
 .../internal/interop/InteropException.java      | 65 ++++++++++++++
 .../processors/cache/GridCacheAdapter.java      | 16 +++-
 .../processors/hadoop/v2/HadoopV2Context.java   | 10 +--
 .../testsuites/IgniteHadoopTestSuite.java       |  2 +-
 .../config/benchmark-client-mode.properties     | 89 ++++++++++++++++++++
 5 files changed, 172 insertions(+), 10 deletions(-)
----------------------------------------------------------------------



[08/20] incubator-ignite git commit: #[IGNITE-928]: Array out of bounds in IgniteUtils.filterReachable

Posted by sb...@apache.org.
#[IGNITE-928]: Array out of bounds in IgniteUtils.filterReachable


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

Branch: refs/heads/ignite-23
Commit: 050f4292f3526d2306336383c6e9e5b0d6df638e
Parents: 6ba171f
Author: iveselovskiy <iv...@gridgain.com>
Authored: Fri May 22 21:40:06 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Fri May 22 21:40:06 2015 +0300

----------------------------------------------------------------------
 .../ClientAbstractConnectivitySelfTest.java           | 14 ++++++++++++++
 .../org/apache/ignite/internal/util/IgniteUtils.java  |  6 ++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/050f4292/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java
index 7272b2c..5aec7e5 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.client.integration;
 
 import org.apache.ignite.*;
 import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.util.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
@@ -123,6 +124,19 @@ public abstract class ClientAbstractConnectivitySelfTest extends GridCommonAbstr
     }
 
     /**
+     * Simple test of address list filtering.
+     * @throws Exception
+     */
+    public void testResolveReachableOneAddress() throws Exception {
+        InetAddress addr = InetAddress.getByAddress(new byte[] {127, 0, 0, 1} );
+
+        List <InetAddress> filtered = IgniteUtils.filterReachable(Collections.singletonList(addr));
+
+        assertEquals(1, filtered.size());
+        assertEquals(addr, filtered.get(0));
+    }
+
+    /**
      * Tests correct behavior in case of 1 REST-enabled node
      * with explicitly specified loopback address setting.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/050f4292/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 673287d..0932212 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -1532,8 +1532,10 @@ public abstract class IgniteUtils {
             return Collections.emptyList();
 
         if (addrs.size() == 1) {
-            if (reachable(addrs.get(1), reachTimeout))
-                return Collections.singletonList(addrs.get(1));
+            InetAddress addr = addrs.get(0);
+
+            if (reachable(addr, reachTimeout))
+                return Collections.singletonList(addr);
 
             return Collections.emptyList();
         }


[05/20] incubator-ignite git commit: # ignie-456

Posted by sb...@apache.org.
# ignie-456


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

Branch: refs/heads/ignite-23
Commit: a25353377ef44de8a31d0c88ed0e8aee0d949167
Parents: 4929c7d
Author: null <null>
Authored: Fri May 22 16:24:52 2015 +0300
Committer: null <null>
Committed: Fri May 22 16:24:52 2015 +0300

----------------------------------------------------------------------
 .gitignore                                 |   3 +-
 dev-tools/slurp.sh                         |  74 +++++++++++++
 dev-tools/src/main/groovy/jiraslurp.groovy | 132 +++++++++++++-----------
 3 files changed, 150 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a2535337/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 296e130..3da8e4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,4 +19,5 @@ atlassian-ide-plugin.xml
 target
 /libs/
 pom-installed.xml
-git-patch-prop-local.sh
\ No newline at end of file
+git-patch-prop-local.sh
+/slurp.sh

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a2535337/dev-tools/slurp.sh
----------------------------------------------------------------------
diff --git a/dev-tools/slurp.sh b/dev-tools/slurp.sh
new file mode 100644
index 0000000..bf1e91a
--- /dev/null
+++ b/dev-tools/slurp.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+#
+# 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.
+#
+
+#
+# Copy this script file at root of ignite repo.
+# Fill all variables.
+#
+
+#
+# Default branch name. Need to use last version of "jiraslurp" scripts.
+#
+DEFAULT_BRANCH='ignite-sprint-5'
+
+#
+# TC URL. It is 10.30.0.229 for public TC from agents.
+#
+TC_URL='10.30.0.229'
+
+#
+# Jira user name to add comments aboyt triggered builds.
+#
+JIRA_USER='tc_commenter'
+
+#
+# Jira password.
+#
+JIRA_PWD=''
+
+#
+# TC user which have permissions to trigger new builds.
+#
+TASK_RUNNER_USER='task_runner'
+
+#
+# TC user password.
+#
+TASK_RUNNER_PWD=''
+
+#
+# Space separated logins of jira useres which were approved to auto triggering patches. Like 'user1 user2 user3'.
+#
+JIRA_CONTRIBUTORS=''
+
+git fetch
+
+git checkout ${DEFAULT_BRANCH}
+
+git pull
+
+export TC_URL=${TC_URL}
+export GIT_USER_NAME=${GIT_USER_NAME}
+export GIT_USER_EMAIL=${GIT_USER_EMAIL}
+export JIRA_USER=${JIRA_USER}
+export JIRA_PWD=${JIRA_PWD}
+export TASK_RUNNER_PWD=${TASK_RUNNER_PWD}
+export TASK_RUNNER_USER=${TASK_RUNNER_USER}
+export JIRA_CONTRIBUTORS=${JIRA_CONTRIBUTORS}
+
+gradle slurp -b dev-tools/build.gradle

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a2535337/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
index 32a6e43..d70bb32 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -14,6 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+def envVariable = { name, defaultVar ->
+    def res = System.getenv(name as String)
+
+    if (res == 'null' || res == null)
+        return defaultVar
+
+    res
+}
+
+def envVariableAsList = { name, defaultList ->
+    def list = System.getenv(name as String)?.split(' ') as List
+
+    if (list == 'null' || list == null)
+        return defaultList
+
+    list
+}
+
 /**
  * Parsing a special filter from Apache Ignite JIRA and picking up latest by ID
  * attachments to process.
@@ -25,7 +44,12 @@ final validated_filename = "${System.getProperty("user.home")}/validated-jira.tx
 final LAST_SUCCESSFUL_ARTIFACT = "guestAuth/repository/download/Ignite_PatchValidation_PatchChecker/.lastSuccessful/$validated_filename"
 
 final def JIRA_CMD = System.getProperty('JIRA_COMMAND', 'jira.sh')
-LinkedHashMap<String, String> jirasAttached = [:]
+
+// Envariement variables.
+final def TC_PROJECT_NAME = envVariable("PROJECT_NAME", "Ignite")
+
+final def CONTRIBUTORS = envVariableAsList("JIRA_CONTRIBUTORS", [])
+final def TC_BUILD_EXCLUDE_LIST = envVariableAsList("BUILD_ID_EXCLUDES", ["Ignite_RunAllTestBuilds"])
 
 /**
  * Gets jiras for which test tasks were already triggered.
@@ -37,29 +61,12 @@ def readHistory = {
 
     List validated_list = []
 
-    // TODO do not use folder.
     def validated = new File(validated_filename)
 
     if (validated.exists()) {
-        // TODO use commented way.
         validated_list = validated.text.split('\n')
     }
 
-    // TODO use it way.
-//    try {
-//        def historyUrl = "http://${System.getenv('TC_URL')}/$LAST_SUCCESSFUL_ARTIFACT"
-//
-//        println "Reading history from $historyUrl"
-//
-//        validated_list = new URL(historyUrl).text.split('\n')
-//
-//        println "Got validated list=$validated_list"
-//    }
-//    catch (Exception e) {
-//        println e.getMessage()
-//
-//    }
-
     // Let's make sure the preserved history isn't too long
     if (validated_list.size > MAX_HISTORY)
         validated_list = validated_list[validated_list.size - MAX_HISTORY..validated_list.size - 1]
@@ -74,34 +81,46 @@ def readHistory = {
  * @return <code>null</code> or <code>JIRA-###,latest_attach_id</code>
  */
 def getLatestAttachment = { jira ->
-    def latestAttr = jira.attachments[0].attachment.list().sort {
-        it.@id.toInteger()
-    }.reverse()[0]
+    def attachment = jira.attachments[0].attachment.list()
+        .sort { it.@id.toInteger() }
+        .reverse()
+        .find {
+            def fName = it.@name.toString()
+
+            CONTRIBUTORS.contains(it.@author as String) &&
+                (fName.endsWith(".patch") || fName.endsWith(".txt") || fName.endsWith(".diff"))
+        }
 
     String row = null
 
-    if (latestAttr == null) {
-        println "${jira.key} is in invalid state: patch is not available"
+    if (attachment == null) {
+        println "${jira.key} is in invalid state: there was not found '.{patch/txt/diff}'-file from approved user."
     }
     else {
-        row = "${jira.key},${latestAttr.@id}"
+        row = "${jira.key},${attachment.@id}"
     }
 }
 
-def checkForAttachments = {
+/**
+ * Checks all "Patch availiable" jiras on attached ".patch"-files from approved users.
+ */
+def findAttachments = {
+    // See https://issues.apache.org/jira/issues/?filter=12330308 (the same).
     def JIRA_FILTER =
         "https://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/12330308/SearchRequest-12330308.xml?tempMax=100&field=key&field=attachments"
     def rss = new XmlSlurper().parse(JIRA_FILTER)
 
     List list = readHistory {}
 
+    LinkedHashMap<String, String> attachments = [:]
+
     rss.channel.item.each { jira ->
         String row = getLatestAttachment(jira)
 
         if (row != null && !list.contains(row)) {
             def pair = row.split(',')
 
-            jirasAttached.put(pair[0] as String, pair[1] as String)
+            attachments.put(pair[0] as String, pair[1] as String)
 
             list.add(row)
         }
@@ -114,6 +133,8 @@ def checkForAttachments = {
         validated.delete()
 
     validated << list.join('\n')
+
+    attachments
 }
 
 /**
@@ -142,6 +163,8 @@ def applyPatch = { jira, attachementURL ->
     def patchFile = new File("${jira}-${attachementURL}.patch")
 
     try {
+        println "Getting patch content."
+
         patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text
 
         try {
@@ -163,7 +186,16 @@ def applyPatch = { jira, attachementURL ->
         catch (Exception e) {
             println "Patch was not applied successfully. Aborting patch applying."
 
-            checkprocess "git am --abort".execute(null, new File("../"))
+            try {
+                checkprocess "git am --abort".execute(null, new File("../"))
+
+                print "Succsessfull: git am --abort."
+            }
+            catch (Exception e2) {
+                print "Error: git am --abort fails: "
+
+                e2.printStackTrace()
+            }
 
             throw e;
         }
@@ -181,19 +213,9 @@ def JIRA_xml = { jiranum ->
  * Gets all builds from TC project.
  */
 def getTestBuilds = { ->
-    def projName = System.getenv('PROJECT_NAME')
-
-    if (projName == null || projName == 'null')
-        projName = "Ignite"
-
     def tcURL = System.getenv('TC_URL')
-    def excludeListProp = System.getenv('BUILD_ID_EXCLUDES')
-    def excludeList = excludeListProp?.split(' ') as List
 
-    if (excludeList == null || excludeList == 'null')
-        excludeList = ["Ignite_RunAllTestBuilds"]
-
-    def project = new XmlSlurper().parse("http://$tcURL:80/guestAuth/app/rest/projects/id:$projName")
+    def project = new XmlSlurper().parse("http://$tcURL:80/guestAuth/app/rest/projects/id:$TC_PROJECT_NAME")
 
     def buildIds = []
 
@@ -202,7 +224,7 @@ def getTestBuilds = { ->
     for (int i = 0; i < count; i++) {
         def id = project.buildTypes.buildType[i].@id
 
-        if (excludeList == null || !excludeList.contains(id))
+        if (TC_BUILD_EXCLUDE_LIST == null || !TC_BUILD_EXCLUDE_LIST.contains(id))
             buildIds.add(id)
     }
 
@@ -316,10 +338,6 @@ def runAllTestBuilds = {builds, jiraNum ->
 
             def build = new XmlSlurper().parseText(response)
 
-            println "Triggered build: ${build.buildType.@name}"
-            println "Triggered build url: ${build.@webUrl}"
-            println "Triggered build branch: ${build.@branchName}"
-
             triggeredBuilds.put(build.buildType.@name, build.@webUrl)
         }
         catch (Exception e) {
@@ -338,6 +356,16 @@ def runAllTestBuilds = {builds, jiraNum ->
 
 /**
  * Main.
+ *
+ * Modes:
+ * 1. "slurp" mode - triggers all TC test builds for all jiras with valid attachment
+ * (Jira in "patch availiable" state, there is attached file from approved user with "patch" extension)
+ * 2. "patchApply" mode - gets last valid patch file from given jira number and applies it.
+ * 3. "runAllBuilds" - triggers given jira number for all TC test builds.
+ *
+ * Main workflow:
+ * 1. run in "slurp" mode
+ * 2. each triggered build uses "patchApply" mode to apply latest valid patch.
  */
 args.each {
     println "Arg=$it"
@@ -349,14 +377,14 @@ args.each {
     if (parameters.length >= 1 && parameters[0] == "slurp") {
         println "Running in 'slurp' mode."
 
-        checkForAttachments()
-
         def builds = getTestBuilds()
 
         println "Test builds to be triggered=$builds"
 
+        def attachments = findAttachments()
+
         // For each ticket with new attachment, let's trigger remove build
-        jirasAttached.each { k, v ->
+        attachments.each { k, v ->
             //  Trailing slash is important for download; only need to pass JIRA number
             println "Triggering the test builds for: $k = $ATTACHMENT_URL/$v/"
 
@@ -401,15 +429,3 @@ args.each {
         runAllTestBuilds(builds, jiraNum)
     }
 }
-
-/* Workflow:
-  1. download an attachment if JIRA num's set; otherwise get all latest attachments not mentioned in the
-     validated-jira.txt file from the last successful build
-  2. trigger test build(s) parametrised by JIRA no.
-  3. test build will download JIRA's latest attachment and apply it to currently checked out repo;
-     - build will fail with comment on JIRA if that can not apply
-     - build will post error/success comment depends on the test results
-*/
-// TODO
-//   - TC's test job needs to send a comment to JIRA
-//       $JIRA_CMD -a addComment -s https://issues.apache.org/jira -u ignite-ci -p ci-of-1gnit3 --issue IGNITE-495 --comment "Trying latest version of the jira-cli"


[04/20] incubator-ignite git commit: [IGNITE-909]: Support HadoopExternalSplit in HadoopV2Context to get pig jobs to function.

Posted by sb...@apache.org.
[IGNITE-909]: Support HadoopExternalSplit in HadoopV2Context to get pig jobs to function.


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

Branch: refs/heads/ignite-23
Commit: c2734e4135c5bda3126c0ad865eb0c8e886c16ad
Parents: b375aaa
Author: Evans Ye <in...@gmail.com>
Authored: Fri May 22 16:00:42 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Fri May 22 16:00:42 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/hadoop/v2/HadoopV2Context.java    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c2734e41/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Context.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Context.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Context.java
index 3f8e2b6..53159b1 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Context.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Context.java
@@ -89,12 +89,12 @@ public class HadoopV2Context extends JobContextImpl implements MapContext, Reduc
 
                 inputSplit = new FileSplit(new Path(fileBlock.file()), fileBlock.start(), fileBlock.length(), null);
             }
-            else if (split instanceof HadoopExternalSplit)
-                throw new UnsupportedOperationException(); // TODO
-            else if (split instanceof HadoopSplitWrapper)
-                inputSplit = (InputSplit) HadoopUtils.unwrapSplit((HadoopSplitWrapper) split);
             else
-                throw new IllegalStateException();
+                try {
+                    inputSplit = (InputSplit) ((HadoopV2TaskContext)ctx).getNativeSplit(split);
+                } catch (IgniteCheckedException e) {
+                    throw new IllegalStateException(e);
+                }
         }
 
         return inputSplit;