ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [02/50] [abbrv] incubator-ignite git commit: # ignite-63
Date Fri, 23 Jan 2015 09:02:10 GMT
# ignite-63


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

Branch: refs/heads/ignite-63
Commit: 3402cd4901b45b3dec29bb636550806ac0d7404c
Parents: cd8625f
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Jan 23 10:29:57 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Jan 23 10:29:57 2015 +0300

----------------------------------------------------------------------
 modules/extdata/p2p/META-INF/gridgain.xml       |   6 +-
 .../tests/p2p/GridCacheDeploymentTestKey.java   |  63 ++++++++
 .../tests/p2p/GridCacheDeploymentTestTask1.java |  65 ++++++++
 .../tests/p2p/GridCacheDeploymentTestTask2.java |  56 +++++++
 .../tests/p2p/GridCacheDeploymentTestTask3.java |  61 +++++++
 .../tests/p2p/GridCacheDeploymentTestValue.java |  26 +++
 .../p2p/GridCacheDeploymentTestValue2.java      |  24 +++
 .../p2p/GridCacheDeploymentTestValue3.java      |  42 +++++
 .../tests/p2p/GridEventConsumeFilter.java       |  31 ++++
 .../GridEventConsumeProjectionPredicate.java    |  31 ++++
 .../ignite/tests/p2p/GridExcludeNodeFilter.java |  52 ++++++
 .../tests/p2p/GridExternalAffinityFunction.java | 161 +++++++++++++++++++
 .../p2p/GridExternalAffinityKeyMapper.java      |  38 +++++
 .../tests/p2p/GridP2PAwareTestUserResource.java |  64 ++++++++
 .../p2p/GridP2PContinuousDeploymentTask1.java   |  52 ++++++
 .../p2p/GridP2PContinuousDeploymentTask2.java   |  46 ++++++
 .../p2p/GridP2PEventFilterExternalPath1.java    |  50 ++++++
 .../p2p/GridP2PEventFilterExternalPath2.java    |  50 ++++++
 .../tests/p2p/GridP2PTestTaskExternalPath1.java | 144 +++++++++++++++++
 .../tests/p2p/GridP2PTestTaskExternalPath2.java | 137 ++++++++++++++++
 .../tests/p2p/GridSingleSplitTestJobTarget.java |  34 ++++
 .../tests/p2p/GridSingleSplitTestTask.java      |  76 +++++++++
 .../tests/p2p/GridTestMessageListener.java      |  56 +++++++
 .../ignite/tests/p2p/GridTestMessageTopic.java  |  35 ++++
 .../ignite/tests/p2p/GridTestUserResource.java  |  27 ++++
 .../ignite/tests/p2p/JobStealingTask.java       | 119 ++++++++++++++
 .../org/apache/ignite/tests/p2p/package.html    |  23 +++
 .../tests/p2p/GridCacheDeploymentTestKey.java   |  63 --------
 .../tests/p2p/GridCacheDeploymentTestTask1.java |  65 --------
 .../tests/p2p/GridCacheDeploymentTestTask2.java |  56 -------
 .../tests/p2p/GridCacheDeploymentTestTask3.java |  61 -------
 .../tests/p2p/GridCacheDeploymentTestValue.java |  26 ---
 .../p2p/GridCacheDeploymentTestValue2.java      |  24 ---
 .../p2p/GridCacheDeploymentTestValue3.java      |  42 -----
 .../grid/tests/p2p/GridEventConsumeFilter.java  |  31 ----
 .../GridEventConsumeProjectionPredicate.java    |  31 ----
 .../grid/tests/p2p/GridExcludeNodeFilter.java   |  52 ------
 .../tests/p2p/GridExternalAffinityFunction.java | 161 -------------------
 .../p2p/GridExternalAffinityKeyMapper.java      |  38 -----
 .../tests/p2p/GridP2PAwareTestUserResource.java |  64 --------
 .../p2p/GridP2PContinuousDeploymentTask1.java   |  52 ------
 .../p2p/GridP2PContinuousDeploymentTask2.java   |  46 ------
 .../p2p/GridP2PEventFilterExternalPath1.java    |  50 ------
 .../p2p/GridP2PEventFilterExternalPath2.java    |  50 ------
 .../tests/p2p/GridP2PTestTaskExternalPath1.java | 144 -----------------
 .../tests/p2p/GridP2PTestTaskExternalPath2.java | 137 ----------------
 .../tests/p2p/GridSingleSplitTestJobTarget.java |  34 ----
 .../grid/tests/p2p/GridSingleSplitTestTask.java |  77 ---------
 .../grid/tests/p2p/GridTestMessageListener.java |  56 -------
 .../grid/tests/p2p/GridTestMessageTopic.java    |  35 ----
 .../grid/tests/p2p/GridTestUserResource.java    |  27 ----
 .../grid/tests/p2p/JobStealingTask.java         | 119 --------------
 .../org/gridgain/grid/tests/p2p/package.html    |  23 ---
 .../deployment/uri/META-INF/p2p-gridgain.xml    |   4 +-
 54 files changed, 1568 insertions(+), 1569 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/META-INF/gridgain.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/META-INF/gridgain.xml b/modules/extdata/p2p/META-INF/gridgain.xml
index 5eead6b..01774f3 100644
--- a/modules/extdata/p2p/META-INF/gridgain.xml
+++ b/modules/extdata/p2p/META-INF/gridgain.xml
@@ -33,8 +33,8 @@
         tasks found inside GAR will be deployed.
     -->
     <util:list id="tasks">
-        <value>org.gridgain.grid.tests.p2p.GridP2PTestTaskExternalPath1</value>
-        <value>org.gridgain.grid.tests.p2p.GridP2PTestTaskExternalPath2</value>
-        <value>org.gridgain.grid.tests.p2p.GridSingleSplitTestTask</value>
+        <value>org.apache.ignite.tests.p2p.GridP2PTestTaskExternalPath1</value>
+        <value>org.apache.ignite.tests.p2p.GridP2PTestTaskExternalPath2</value>
+        <value>org.apache.ignite.tests.p2p.GridSingleSplitTestTask</value>
     </util:list>
 </beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestKey.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestKey.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestKey.java
new file mode 100644
index 0000000..6cca646
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestKey.java
@@ -0,0 +1,63 @@
+/*
+ * 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.tests.p2p;
+
+/**
+ * Test key for cache deployment tests.
+ */
+public class GridCacheDeploymentTestKey {
+    /** */
+    private String key;
+
+    /**
+     * Empty constructor.
+     */
+    public GridCacheDeploymentTestKey() {
+        // No-op.
+    }
+
+    /**
+     * @param key Key.
+     */
+    public GridCacheDeploymentTestKey(String key) {
+        this.key = key;
+    }
+
+    /**
+     * @param key Key value.
+     */
+    public void key(String key) {
+        this.key = key;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        GridCacheDeploymentTestKey that = (GridCacheDeploymentTestKey)o;
+
+        return !(key != null ? !key.equals(that.key) : that.key != null);
+
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        return key != null ? key.hashCode() : 0;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask1.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask1.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask1.java
new file mode 100644
index 0000000..4be4c9c
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask1.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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Test task for {@code GridCacheDeploymentSelfTest}.
+ */
+public class GridCacheDeploymentTestTask1 extends ComputeTaskAdapter<ClusterNode, Object> {
+    /** Number of puts. */
+    private static final int PUT_CNT = 100;
+
+    /** {@inheritDoc} */
+    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+        @Nullable ClusterNode node) throws IgniteCheckedException {
+        return F.asMap(
+            new ComputeJobAdapter() {
+                @IgniteInstanceResource
+                private Ignite ignite;
+
+                @Override public Object execute() throws IgniteCheckedException {
+                    X.println("Executing GridCacheDeploymentTestTask1 job on node " +
+                        ignite.cluster().localNode().id());
+
+                    GridCache<String, GridCacheDeploymentTestValue> cache = ignite.cache(null);
+
+                    for (int i = 0; i < PUT_CNT; i++)
+                        cache.putx("1" + i, new GridCacheDeploymentTestValue());
+
+                    return null;
+                }
+            },
+            node
+        );
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask2.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask2.java
new file mode 100644
index 0000000..cfd97e7
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask2.java
@@ -0,0 +1,56 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Test task for {@code GridCacheDeploymentSelfTest}.
+ */
+public class GridCacheDeploymentTestTask2 extends ComputeTaskAdapter<ClusterNode, Object> {
+    /** {@inheritDoc} */
+    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+        @Nullable ClusterNode node) throws IgniteCheckedException {
+        return F.asMap(
+            new ComputeJobAdapter() {
+                @IgniteInstanceResource
+                private Ignite ignite;
+
+                @Override public Object execute() {
+                    X.println("Executing GridCacheDeploymentTestTask2 job on node " +
+                        ignite.cluster().localNode().id());
+
+                    return null;
+                }
+            },
+            node
+        );
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask3.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask3.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask3.java
new file mode 100644
index 0000000..1aec857
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestTask3.java
@@ -0,0 +1,61 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Test task for {@code GridCacheDeploymentSelfTest}.
+ */
+public class GridCacheDeploymentTestTask3 extends ComputeTaskAdapter<T2<ClusterNode, String>, Object> {
+    /** {@inheritDoc} */
+    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+        @Nullable T2<ClusterNode, String> tup) throws IgniteCheckedException {
+        final String val = tup.getValue();
+
+        return F.asMap(
+                new ComputeJobAdapter() {
+                    @IgniteInstanceResource
+                    private Ignite ignite;
+
+                    @Override public Object execute() throws IgniteCheckedException {
+                        X.println("Executing GridCacheDeploymentTestTask3 job on node " +
+                                ignite.cluster().localNode().id());
+
+                        ignite.<String, GridCacheDeploymentTestValue>cache(null).putx(val,
+                                new GridCacheDeploymentTestValue());
+
+                        return null;
+                    }
+                },
+                tup.get1()
+        );
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue.java
new file mode 100644
index 0000000..0376fd0
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue.java
@@ -0,0 +1,26 @@
+/*
+ * 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.tests.p2p;
+
+import java.io.*;
+
+/**
+ * Value object for {@code GridCacheDeploymentSelfTest}.
+ */
+public class GridCacheDeploymentTestValue implements Serializable {
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue2.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue2.java
new file mode 100644
index 0000000..50bcef1
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue2.java
@@ -0,0 +1,24 @@
+/*
+ * 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.tests.p2p;
+
+/**
+ * Second test value for deployment.
+ */
+public class GridCacheDeploymentTestValue2 {
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue3.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue3.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue3.java
new file mode 100644
index 0000000..9074fb9
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridCacheDeploymentTestValue3.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.tests.p2p;
+
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.io.*;
+
+/**
+ *
+ */
+public class GridCacheDeploymentTestValue3 implements Serializable {
+    /** */
+    private String val = "test-" + System.currentTimeMillis();
+
+    /**
+     * @return Value.
+     */
+    public String getValue() {
+        return val;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridCacheDeploymentTestValue3.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridEventConsumeFilter.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridEventConsumeFilter.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridEventConsumeFilter.java
new file mode 100644
index 0000000..fdcc29c
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridEventConsumeFilter.java
@@ -0,0 +1,31 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.util.typedef.*;
+
+/**
+ * Filter for event consume test.
+ */
+public class GridEventConsumeFilter implements P1<IgniteEvent> {
+    /** {@inheritDoc} */
+    @Override public boolean apply(IgniteEvent e) {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridEventConsumeProjectionPredicate.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridEventConsumeProjectionPredicate.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridEventConsumeProjectionPredicate.java
new file mode 100644
index 0000000..fb54c8b
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridEventConsumeProjectionPredicate.java
@@ -0,0 +1,31 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.util.typedef.*;
+
+/**
+ * Projection predicate for event consume test.
+ */
+public class GridEventConsumeProjectionPredicate implements PN {
+    /** {@inheritDoc} */
+    @Override public boolean apply(ClusterNode n) {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExcludeNodeFilter.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExcludeNodeFilter.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExcludeNodeFilter.java
new file mode 100644
index 0000000..85d0ffa
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExcludeNodeFilter.java
@@ -0,0 +1,52 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.util.*;
+
+/**
+ * This node filter excludes the node with the given UUID
+ * from the topology.
+ */
+public class GridExcludeNodeFilter implements IgnitePredicate<ClusterNode> {
+    /** Node ID to exclude. */
+    private final UUID excludeId;
+
+    /**
+     * @param excludeId Excluded node UUID.
+     */
+    public GridExcludeNodeFilter(UUID excludeId) {
+        assert excludeId != null;
+
+        this.excludeId = excludeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(ClusterNode e) {
+        return !excludeId.equals(e.id());
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridExcludeNodeFilter.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExternalAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExternalAffinityFunction.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExternalAffinityFunction.java
new file mode 100644
index 0000000..ef7d3f5
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExternalAffinityFunction.java
@@ -0,0 +1,161 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.util.*;
+
+/**
+ * Mock affinity implementation that ensures constant key-to-node mapping based on {@code GridCacheModuloAffinity} The
+ * partition selection is as follows: 0 maps to partition 1 and any other value maps to partition 1.
+ */
+public class GridExternalAffinityFunction implements GridCacheAffinityFunction {
+    /** Node attribute for index. */
+    public static final String IDX_ATTR = "nodeIndex";
+
+    /** Number of backups. */
+    private int backups;
+
+    /** Number of partitions. */
+    private int parts;
+
+    /** Empty constructor. Equivalent for {@code new GridCacheModuloAffinity(2, 0)}. */
+    public GridExternalAffinityFunction() {
+        this(2, 0);
+    }
+
+    /**
+     * @param parts   Number of partitions.
+     * @param backups Number of backups.
+     */
+    public GridExternalAffinityFunction(int parts, int backups) {
+        assert parts > 0;
+        assert backups >= 0;
+
+        this.parts = parts;
+        this.backups = backups;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
+    @Override public List<List<ClusterNode>> assignPartitions(GridCacheAffinityFunctionContext ctx) {
+        List<List<ClusterNode>> res = new ArrayList<>(partitions());
+
+        List<ClusterNode> topSnapshot = ctx.currentTopologySnapshot();
+
+        for (int part = 0; part < parts; part++) {
+            res.add(F.isEmpty(topSnapshot) ?
+                Collections.<ClusterNode>emptyList() :
+                // Wrap affinity nodes with unmodifiable list since unmodifiable generic collection
+                // doesn't provide equals and hashCode implementations.
+                U.sealList(nodes(part, topSnapshot)));
+        }
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    public Collection<ClusterNode> nodes(int part, Collection<ClusterNode> nodes) {
+        List<ClusterNode> sorted = new ArrayList<>(nodes);
+
+        Collections.sort(sorted, new Comparator<ClusterNode>() {
+            @Override public int compare(ClusterNode n1, ClusterNode n2) {
+                int idx1 = n1.<Integer>attribute(IDX_ATTR);
+                int idx2 = n2.<Integer>attribute(IDX_ATTR);
+
+                return idx1 < idx2 ? -1 : idx1 == idx2 ? 0 : 1;
+            }
+        });
+
+        int max = 1 + backups;
+
+        if (max > nodes.size())
+            max = nodes.size();
+
+        Collection<ClusterNode> ret = new ArrayList<>(max);
+
+        Iterator<ClusterNode> it = sorted.iterator();
+
+        for (int i = 0; i < max; i++) {
+            ClusterNode n = null;
+
+            if (i == 0) {
+                while (it.hasNext()) {
+                    n = it.next();
+
+                    int nodeIdx = n.<Integer>attribute(IDX_ATTR);
+
+                    if (part <= nodeIdx)
+                        break;
+                    else
+                        n = null;
+                }
+            }
+            else {
+                if (it.hasNext())
+                    n = it.next();
+                else {
+                    it = sorted.iterator();
+
+                    assert it.hasNext();
+
+                    n = it.next();
+                }
+            }
+
+            assert n != null || nodes.size() < parts;
+
+            if (n == null)
+                n = (it = sorted.iterator()).next();
+
+            ret.add(n);
+        }
+
+        return ret;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void reset() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public int partitions() {
+        return parts;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int partition(Object key) {
+        return key instanceof Integer ? 0 == key ? 0 : 1 : 1;
+    }
+
+    /** {@inheritDoc}
+     * @param nodeId*/
+    @Override public void removeNode(UUID nodeId) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridExternalAffinityFunction.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExternalAffinityKeyMapper.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExternalAffinityKeyMapper.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExternalAffinityKeyMapper.java
new file mode 100644
index 0000000..9ebca88
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridExternalAffinityKeyMapper.java
@@ -0,0 +1,38 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.cache.affinity.*;
+
+/**
+ * Test mapper for P2P class loading tests.
+ */
+public class GridExternalAffinityKeyMapper implements GridCacheAffinityKeyMapper {
+    /** {@inheritDoc} */
+    @Override public Object affinityKey(Object key) {
+        if (key instanceof Integer)
+            return 1 == (Integer)key ? key : 0;
+
+        return key;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void reset() {
+        // This mapper is stateless and needs no initialization logic.
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PAwareTestUserResource.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PAwareTestUserResource.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PAwareTestUserResource.java
new file mode 100644
index 0000000..2641f9c
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PAwareTestUserResource.java
@@ -0,0 +1,64 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.resources.*;
+
+/**
+ * User resource, that increases node-local counters
+ * on deploy and undeploy.
+ */
+public class GridP2PAwareTestUserResource {
+    /** Deploy counter key. */
+    private static final String DEPLOY_CNT_KEY = "deployCnt";
+
+    /** Undeploy counter key. */
+    private static final String UNDEPLOY_CNT_KEY = "undeployCnt";
+
+    /** Grid instance. */
+    @IgniteInstanceResource
+    private Ignite ignite;
+
+    /** Grid logger. */
+    @IgniteLoggerResource
+    private IgniteLogger log;
+
+    /**
+     * Concurrently increments numeric cache value.
+     *
+     * @param key Key for the value to be incremented.
+     */
+    private <T> void concurrentIncrement(T key) {
+        ClusterNodeLocalMap<T, Integer> nodeLoc = ignite.cluster().nodeLocalMap();
+
+        Integer cntr = nodeLoc.get(key);
+
+        if (cntr == null)
+            cntr = nodeLoc.putIfAbsent(key, 1);
+
+        if (cntr != null) {
+            while (!nodeLoc.replace(key, cntr, cntr + 1)) {
+                cntr = nodeLoc.get(key);
+
+                assert cntr != null;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PContinuousDeploymentTask1.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PContinuousDeploymentTask1.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PContinuousDeploymentTask1.java
new file mode 100644
index 0000000..02f4786
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PContinuousDeploymentTask1.java
@@ -0,0 +1,52 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Test task for {@code GridP2PContinuousDeploymentSelfTest}.
+ */
+public class GridP2PContinuousDeploymentTask1 extends ComputeTaskSplitAdapter<Object, Object> {
+    /** {@inheritDoc} */
+    @Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) throws IgniteCheckedException {
+        return Collections.singleton(new ComputeJobAdapter() {
+            @IgniteInstanceResource
+            private Ignite ignite;
+
+            @Override public Object execute() throws IgniteCheckedException {
+                X.println(">>> Executing GridP2PContinuousDeploymentTask1 job.");
+
+                ignite.cache(null).putx("key", new GridTestUserResource());
+
+                return null;
+            }
+        });
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PContinuousDeploymentTask2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PContinuousDeploymentTask2.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PContinuousDeploymentTask2.java
new file mode 100644
index 0000000..6625a11
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PContinuousDeploymentTask2.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Test task for {@code GridP2PContinuousDeploymentSelfTest}.
+ */
+public class GridP2PContinuousDeploymentTask2 extends ComputeTaskSplitAdapter<Object, Object> {
+    /** {@inheritDoc} */
+    @Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) throws IgniteCheckedException {
+        return Collections.singleton(new ComputeJobAdapter() {
+            @Override public Object execute() {
+                X.println(">>> Executing GridP2PContinuousDeploymentTask2 job.");
+
+                return null;
+            }
+        });
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PEventFilterExternalPath1.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PEventFilterExternalPath1.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PEventFilterExternalPath1.java
new file mode 100644
index 0000000..86ef3cf
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PEventFilterExternalPath1.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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.gridgain.grid.*;
+
+/**
+ * Simple event filter
+ */
+@SuppressWarnings({"ProhibitedExceptionThrown"})
+public class GridP2PEventFilterExternalPath1 implements IgnitePredicate<IgniteEvent> {
+    /** Instance of grid. Used for save class loader and injected resource. */
+    @IgniteInstanceResource
+    private Ignite ignite;
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(IgniteEvent evt) {
+        try {
+            int[] res = new int[] {
+                System.identityHashCode(getClass().getClassLoader())
+            };
+
+            ignite.message(ignite.cluster().forRemotes()).send(null, res);
+        }
+        catch (IgniteCheckedException e) {
+            throw new RuntimeException(e);
+        }
+
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PEventFilterExternalPath2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PEventFilterExternalPath2.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PEventFilterExternalPath2.java
new file mode 100644
index 0000000..bec4f77
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PEventFilterExternalPath2.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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.gridgain.grid.*;
+
+/**
+ * Simple event filter
+ */
+@SuppressWarnings({"ProhibitedExceptionThrown"})
+public class GridP2PEventFilterExternalPath2 implements IgnitePredicate<IgniteEvent> {
+    /** Instance of grid. Used for save class loader and injected resource. */
+    @IgniteInstanceResource
+    private Ignite ignite;
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(IgniteEvent evt) {
+        try {
+            int[] res = new int[] {
+                System.identityHashCode(getClass().getClassLoader())
+            };
+
+            ignite.message(ignite.cluster().forRemotes()).send(null, res);
+        }
+        catch (IgniteCheckedException e) {
+            throw new RuntimeException(e);
+        }
+
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PTestTaskExternalPath1.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PTestTaskExternalPath1.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PTestTaskExternalPath1.java
new file mode 100644
index 0000000..fa24f72
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PTestTaskExternalPath1.java
@@ -0,0 +1,144 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.util.*;
+
+/**
+ * Test P2P task.
+ */
+public class GridP2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, Integer> {
+    /** */
+    @IgniteLoggerResource
+    private IgniteLogger log;
+
+    /**
+     * {@inheritDoc}
+     */
+    @SuppressWarnings({"unchecked"})
+    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) throws IgniteCheckedException {
+        if (log.isInfoEnabled()) {
+            log.info("Mapping [task=" + this + ", subgrid=" + F.viewReadOnly(subgrid, F.node2id()) +
+                ", arg=" + arg + ']');
+        }
+
+        Set<UUID> nodeIds;
+
+        boolean sleep;
+
+        if (arg instanceof Object[]) {
+            nodeIds = Collections.singleton((UUID)(((Object[])arg)[0]));
+
+            sleep = (Boolean)((Object[])arg)[1];
+        }
+        else if (arg instanceof List) {
+            nodeIds = new HashSet<>((Collection<UUID>)arg);
+
+            sleep = false;
+        }
+        else {
+            nodeIds = Collections.singleton((UUID)arg);
+
+            sleep = false;
+        }
+
+        Map<TestJob, ClusterNode> jobs = U.newHashMap(subgrid.size());
+
+        for (ClusterNode node : subgrid) {
+            if (nodeIds.contains(node.id()))
+                jobs.put(new TestJob(node.id(), sleep), node);
+        }
+
+        if (!jobs.isEmpty())
+            return jobs;
+
+        throw new IgniteCheckedException("Failed to find target node: " + arg);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override public Integer reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        return results.get(0).getData();
+    }
+
+    /**
+     * Simple job class
+     */
+    @SuppressWarnings({"PublicInnerClass"})
+    public static class TestJob extends ComputeJobAdapter {
+        /** Task session. */
+        @IgniteTaskSessionResource
+        private ComputeTaskSession ses;
+
+        /** */
+        @IgniteLoggerResource
+        private IgniteLogger log;
+
+        /** */
+        @IgniteInstanceResource
+        private Ignite g;
+
+        /** */
+        private boolean sleep;
+
+        /**
+         *
+         */
+        public TestJob() {
+            // No-op.
+        }
+
+        /**
+         * @param nodeId Node ID for node this job is supposed to execute on.
+         * @param sleep Sleep flag.
+         */
+        public TestJob(UUID nodeId, boolean sleep) {
+            super(nodeId);
+
+            this.sleep = sleep;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Integer execute() throws IgniteCheckedException {
+            assert g.configuration().getNodeId().equals(argument(0));
+
+            log.info("Running job on node: " + g.cluster().localNode().id());
+
+            if (sleep) {
+                try {
+                    Thread.sleep(Long.MAX_VALUE);
+                }
+                catch (InterruptedException e) {
+                    log.info("Job has been cancelled. Caught exception: " + e);
+
+                    Thread.currentThread().interrupt();
+                }
+            }
+
+            return System.identityHashCode(ses.getClassLoader());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PTestTaskExternalPath2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PTestTaskExternalPath2.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PTestTaskExternalPath2.java
new file mode 100644
index 0000000..5d0fa3a
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridP2PTestTaskExternalPath2.java
@@ -0,0 +1,137 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.util.*;
+
+/**
+ * Simple test task.
+ */
+public class GridP2PTestTaskExternalPath2 extends ComputeTaskAdapter<Object, Integer> {
+    /** */
+    @IgniteLoggerResource
+    private IgniteLogger log;
+
+    /**
+     * {@inheritDoc}
+     */
+    @SuppressWarnings({"unchecked"})
+    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) throws IgniteCheckedException {
+        if (log.isInfoEnabled()) {
+            log.info("Mapping [task=" + this + ", subgrid=" + F.viewReadOnly(subgrid, F.node2id()) +
+                ", arg=" + arg + ']');
+        }
+
+        Set<UUID> nodeIds;
+
+        boolean sleep;
+
+        if (arg instanceof Object[]) {
+            nodeIds = Collections.singleton((UUID)(((Object[])arg)[0]));
+
+            sleep = (Boolean)((Object[])arg)[1];
+        }
+        else if (arg instanceof List) {
+            nodeIds = new HashSet<>((Collection<UUID>)arg);
+
+            sleep = false;
+        }
+        else {
+            nodeIds = Collections.singleton((UUID)arg);
+
+            sleep = false;
+        }
+
+        Map<TestJob, ClusterNode> jobs = U.newHashMap(subgrid.size());
+
+        for (ClusterNode node : subgrid) {
+            if (nodeIds.contains(node.id()))
+                jobs.put(new TestJob(node.id(), sleep), node);
+        }
+
+        if (!jobs.isEmpty())
+            return jobs;
+
+        throw new IgniteCheckedException("Failed to find target node: " + arg);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override public Integer reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        return results.get(0).getData();
+    }
+
+    /**
+     * Simple job class
+     */
+    @SuppressWarnings("PublicInnerClass")
+    public static class TestJob extends ComputeJobAdapter {
+        /** Ignite instance. */
+        @IgniteInstanceResource
+        private Ignite ignite;
+
+        /** Task session. */
+        @IgniteTaskSessionResource
+        private ComputeTaskSession ses;
+
+        /** */
+        @IgniteLoggerResource
+        private IgniteLogger log;
+
+        /**  */
+        private boolean sleep;
+
+        /**
+         * @param nodeId Node ID for node this job is supposed to execute on.
+         * @param sleep Sleep flag.
+         */
+        public TestJob(UUID nodeId, boolean sleep) {
+            super(nodeId);
+
+            this.sleep = sleep;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override public Integer execute() throws IgniteCheckedException {
+            assert ignite.configuration().getNodeId().equals(argument(0));
+
+            if (sleep) {
+                try {
+                    Thread.sleep(Long.MAX_VALUE);
+                }
+                catch (InterruptedException e) {
+                    log.info("Job has been cancelled. Caught exception: " + e);
+
+                    Thread.currentThread().interrupt();
+                }
+            }
+
+            return System.identityHashCode(ses.getClassLoader());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridSingleSplitTestJobTarget.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridSingleSplitTestJobTarget.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridSingleSplitTestJobTarget.java
new file mode 100644
index 0000000..103e61e
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridSingleSplitTestJobTarget.java
@@ -0,0 +1,34 @@
+/*
+ * 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.tests.p2p;
+
+/**
+ * Test class for p2p chained deployment.
+ */
+public class GridSingleSplitTestJobTarget {
+    /**
+     * @param level Test argument.
+     * @return Always 1.
+     */
+    @SuppressWarnings("unused")
+    public int executeLoadTestJob(int level) {
+        assert level > 0;
+
+        return 1;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridSingleSplitTestTask.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridSingleSplitTestTask.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridSingleSplitTestTask.java
new file mode 100644
index 0000000..298cf24
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridSingleSplitTestTask.java
@@ -0,0 +1,76 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.compute.*;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Test task for P2P deployment tests.
+ */
+public class GridSingleSplitTestTask extends ComputeTaskSplitAdapter<Integer, Integer> {
+    /**
+     * {@inheritDoc}
+     */
+    @Override protected Collection<? extends ComputeJob> split(int gridSize, Integer arg) throws IgniteCheckedException {
+        assert gridSize > 0 : "Subgrid cannot be empty.";
+
+        Collection<ComputeJobAdapter> jobs = new ArrayList<>(gridSize);
+
+        for (int i = 0; i < arg; i++)
+            jobs.add(new GridSingleSplitTestJob(1));
+
+        return jobs;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override public Integer reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        int retVal = 0;
+
+        for (ComputeJobResult res : results) {
+            assert res.getException() == null : "Load test jobs can never fail: " + res;
+
+            retVal += (Integer)res.getData();
+        }
+
+        return retVal;
+    }
+
+    /**
+     * Test job for P2P deployment tests.
+     */
+    @SuppressWarnings("PublicInnerClass")
+    public static final class GridSingleSplitTestJob extends ComputeJobAdapter {
+        /**
+         * @param args Job arguments.
+         */
+        public GridSingleSplitTestJob(Integer args) {
+            super(args);
+        }
+
+        /** {@inheritDoc} */
+        @Override public Serializable execute() {
+            return new GridSingleSplitTestJobTarget().executeLoadTestJob((Integer)argument(0));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestMessageListener.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestMessageListener.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestMessageListener.java
new file mode 100644
index 0000000..55a7b60
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestMessageListener.java
@@ -0,0 +1,56 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.internal.util.typedef.*;
+
+import java.util.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * Test message listener.
+ */
+public class GridTestMessageListener implements P2<UUID, Object> {
+    /** */
+    @IgniteInstanceResource
+    private Ignite ignite;
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(UUID nodeId, Object msg) {
+        ignite.log().info("Received message [nodeId=" + nodeId + ", locNodeId=" + ignite.cluster().localNode().id() +
+            ", msg=" + msg + ']');
+
+        ClusterNodeLocalMap<String, AtomicInteger> map = ignite.cluster().nodeLocalMap();
+
+        AtomicInteger cnt = map.get("msgCnt");
+
+        if (cnt == null) {
+            AtomicInteger old = map.putIfAbsent("msgCnt", cnt = new AtomicInteger(0));
+
+            if (old != null)
+                cnt = old;
+        }
+
+        cnt.incrementAndGet();
+
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestMessageTopic.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestMessageTopic.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestMessageTopic.java
new file mode 100644
index 0000000..c332567
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestMessageTopic.java
@@ -0,0 +1,35 @@
+/*
+ * 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.tests.p2p;
+
+import java.io.*;
+
+/**
+ * Test message topic.
+ */
+public class GridTestMessageTopic implements Serializable {
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        return this != o && getClass() == o.getClass();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        return 123;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestUserResource.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestUserResource.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestUserResource.java
new file mode 100644
index 0000000..afd3060
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/GridTestUserResource.java
@@ -0,0 +1,27 @@
+/*
+ * 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.tests.p2p;
+
+import java.io.*;
+
+/**
+ * Test user resource.
+ */
+public class GridTestUserResource implements Serializable {
+    // No-op.
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/JobStealingTask.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/JobStealingTask.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/JobStealingTask.java
new file mode 100644
index 0000000..5aa13b6
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/JobStealingTask.java
@@ -0,0 +1,119 @@
+/*
+ * 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.tests.p2p;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Task for testing job stealing.
+ */
+public class JobStealingTask extends ComputeTaskAdapter<Object, Map<UUID, Integer>> {
+    /** Number of jobs to spawn from task. */
+    private static final int N_JOBS = 4;
+
+    /** Grid. */
+    @IgniteInstanceResource
+    private Ignite ignite;
+
+    /** Logger. */
+    @IgniteLoggerResource
+    private IgniteLogger log;
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("ForLoopReplaceableByForEach")
+    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+        @Nullable Object arg) throws IgniteCheckedException {
+        assert !subgrid.isEmpty();
+
+        Map<ComputeJobAdapter, ClusterNode> map = U.newHashMap(subgrid.size());
+
+        // Put all jobs onto one node.
+        for (int i = 0; i < N_JOBS; i++)
+            map.put(new GridJobStealingJob(5000L), subgrid.get(0));
+
+        return map;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("SuspiciousMethodCalls")
+    @Override public Map<UUID, Integer> reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+        Map<UUID, Integer> ret = U.newHashMap(results.size());
+
+        for (ComputeJobResult res : results) {
+            log.info("Job result: " + res.getData());
+
+            UUID resUuid = (UUID)res.getData();
+
+            ret.put(resUuid,
+                ret.containsKey(resUuid) ? ret.get(resUuid) + 1 : 1);
+        }
+
+        return ret;
+    }
+
+    /**
+     * Job stealing job.
+     */
+    private static final class GridJobStealingJob extends ComputeJobAdapter {
+        /** Injected grid. */
+        @IgniteInstanceResource
+        private Ignite ignite;
+
+        /** Logger. */
+        @IgniteLoggerResource
+        private IgniteLogger log;
+
+        /**
+         * @param arg Job argument.
+         */
+        GridJobStealingJob(Long arg) {
+            super(arg);
+        }
+
+        /** {@inheritDoc} */
+        @Override public Serializable execute() throws IgniteCheckedException {
+            log.info("Started job on node: " + ignite.cluster().localNode().id());
+
+            try {
+                Long sleep = argument(0);
+
+                assert sleep != null;
+
+                Thread.sleep(sleep);
+            }
+            catch (InterruptedException e) {
+                log.info("Job got interrupted on node: " + ignite.cluster().localNode().id());
+
+                throw new IgniteCheckedException("Job got interrupted.", e);
+            }
+            finally {
+                log.info("Job finished on node: " + ignite.cluster().localNode().id());
+            }
+
+            return ignite.cluster().localNode().id();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/package.html
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/package.html b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/package.html
new file mode 100644
index 0000000..1f85ff2
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/package.html
@@ -0,0 +1,23 @@
+<!--
+  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.
+  -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<body>
+    <!-- Package description. -->
+    Contains internal tests or test related classes and interfaces.
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestKey.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestKey.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestKey.java
deleted file mode 100644
index f100a78..0000000
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestKey.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.gridgain.grid.tests.p2p;
-
-/**
- * Test key for cache deployment tests.
- */
-public class GridCacheDeploymentTestKey {
-    /** */
-    private String key;
-
-    /**
-     * Empty constructor.
-     */
-    public GridCacheDeploymentTestKey() {
-        // No-op.
-    }
-
-    /**
-     * @param key Key.
-     */
-    public GridCacheDeploymentTestKey(String key) {
-        this.key = key;
-    }
-
-    /**
-     * @param key Key value.
-     */
-    public void key(String key) {
-        this.key = key;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        GridCacheDeploymentTestKey that = (GridCacheDeploymentTestKey)o;
-
-        return !(key != null ? !key.equals(that.key) : that.key != null);
-
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        return key != null ? key.hashCode() : 0;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask1.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask1.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask1.java
deleted file mode 100644
index ac2d4d0..0000000
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask1.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.gridgain.grid.tests.p2p;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.compute.*;
-import org.apache.ignite.resources.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * Test task for {@code GridCacheDeploymentSelfTest}.
- */
-public class GridCacheDeploymentTestTask1 extends ComputeTaskAdapter<ClusterNode, Object> {
-    /** Number of puts. */
-    private static final int PUT_CNT = 100;
-
-    /** {@inheritDoc} */
-    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
-        @Nullable ClusterNode node) throws IgniteCheckedException {
-        return F.asMap(
-            new ComputeJobAdapter() {
-                @IgniteInstanceResource
-                private Ignite ignite;
-
-                @Override public Object execute() throws IgniteCheckedException {
-                    X.println("Executing GridCacheDeploymentTestTask1 job on node " +
-                        ignite.cluster().localNode().id());
-
-                    GridCache<String, GridCacheDeploymentTestValue> cache = ignite.cache(null);
-
-                    for (int i = 0; i < PUT_CNT; i++)
-                        cache.putx("1" + i, new GridCacheDeploymentTestValue());
-
-                    return null;
-                }
-            },
-            node
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask2.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask2.java
deleted file mode 100644
index 254a5e0..0000000
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask2.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.gridgain.grid.tests.p2p;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.compute.*;
-import org.apache.ignite.resources.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * Test task for {@code GridCacheDeploymentSelfTest}.
- */
-public class GridCacheDeploymentTestTask2 extends ComputeTaskAdapter<ClusterNode, Object> {
-    /** {@inheritDoc} */
-    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
-        @Nullable ClusterNode node) throws IgniteCheckedException {
-        return F.asMap(
-            new ComputeJobAdapter() {
-                @IgniteInstanceResource
-                private Ignite ignite;
-
-                @Override public Object execute() {
-                    X.println("Executing GridCacheDeploymentTestTask2 job on node " +
-                        ignite.cluster().localNode().id());
-
-                    return null;
-                }
-            },
-            node
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask3.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask3.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask3.java
deleted file mode 100644
index d1a6491..0000000
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestTask3.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.gridgain.grid.tests.p2p;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.compute.*;
-import org.apache.ignite.resources.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * Test task for {@code GridCacheDeploymentSelfTest}.
- */
-public class GridCacheDeploymentTestTask3 extends ComputeTaskAdapter<T2<ClusterNode, String>, Object> {
-    /** {@inheritDoc} */
-    @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
-        @Nullable T2<ClusterNode, String> tup) throws IgniteCheckedException {
-        final String val = tup.getValue();
-
-        return F.asMap(
-                new ComputeJobAdapter() {
-                    @IgniteInstanceResource
-                    private Ignite ignite;
-
-                    @Override public Object execute() throws IgniteCheckedException {
-                        X.println("Executing GridCacheDeploymentTestTask3 job on node " +
-                                ignite.cluster().localNode().id());
-
-                        ignite.<String, GridCacheDeploymentTestValue>cache(null).putx(val,
-                                new GridCacheDeploymentTestValue());
-
-                        return null;
-                    }
-                },
-                tup.get1()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue.java
deleted file mode 100644
index e8f986c..0000000
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.gridgain.grid.tests.p2p;
-
-import java.io.*;
-
-/**
- * Value object for {@code GridCacheDeploymentSelfTest}.
- */
-public class GridCacheDeploymentTestValue implements Serializable {
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue2.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue2.java
deleted file mode 100644
index bafc330..0000000
--- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue2.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.gridgain.grid.tests.p2p;
-
-/**
- * Second test value for deployment.
- */
-public class GridCacheDeploymentTestValue2 {
-}


Mime
View raw message