You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dm...@apache.org on 2015/10/27 14:32:46 UTC

[01/16] ignite git commit: Muted test

Repository: ignite
Updated Branches:
  refs/heads/ignite-801 d8b277441 -> 97c859d0a


Muted test


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

Branch: refs/heads/ignite-801
Commit: e6e475c068d41723d69a1b37c906f3b3fc309a8a
Parents: 0bc1d6f
Author: ashutak <as...@gridgain.com>
Authored: Mon Oct 26 13:25:54 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Mon Oct 26 13:25:54 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e6e475c0/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 0bb9a42..030c653 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
@@ -797,6 +797,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testClientNodeFailOneServer() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1776");
+
         startServerNodes(1);
         startClientNodes(1);
 
@@ -2258,4 +2260,4 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
             return res;
         }
     }
-}
\ No newline at end of file
+}


[11/16] ignite git commit: ignite-1272: support of custom class loaders and conditional deployment info for portable marshaller and portable caches

Posted by dm...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 1a869e7..c09a611 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -408,7 +408,8 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
         boolean cancelled = false;
 
         try {
-            res = new GridDhtLockResponse(ctx.cacheId(), req.version(), req.futureId(), req.miniId(), cnt);
+            res = new GridDhtLockResponse(ctx.cacheId(), req.version(), req.futureId(), req.miniId(), cnt,
+                ctx.deploymentEnabled());
 
             dhtTx = startRemoteTx(nodeId, req, res);
             nearTx = isNearEnabled(cacheCfg) ? near().startRemoteTx(nodeId, req) : null;
@@ -435,7 +436,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
             U.error(log, err, e);
 
             res = new GridDhtLockResponse(ctx.cacheId(), req.version(), req.futureId(), req.miniId(),
-                new IgniteTxRollbackCheckedException(err, e));
+                new IgniteTxRollbackCheckedException(err, e), ctx.deploymentEnabled());
 
             fail = true;
         }
@@ -448,7 +449,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                 req.version(),
                 req.futureId(),
                 req.miniId(),
-                new IgniteCheckedException(err, e));
+                new IgniteCheckedException(err, e), ctx.deploymentEnabled());
 
             fail = true;
         }
@@ -1035,7 +1036,8 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
             false,
             0,
             null,
-            topVer);
+            topVer,
+            ctx.deploymentEnabled());
 
         try {
             ctx.io().send(nearNode, res, ctx.ioPolicy());
@@ -1080,7 +1082,8 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                 tx != null && tx.onePhaseCommit(),
                 entries.size(),
                 err,
-                null);
+                null,
+                ctx.deploymentEnabled());
 
             if (err == null) {
                 res.pending(localDhtPendingVersions(entries, mappedVer));
@@ -1196,7 +1199,8 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                 false,
                 entries.size(),
                 e,
-                null);
+                null,
+                ctx.deploymentEnabled());
         }
     }
 
@@ -1522,7 +1526,8 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
 
             List<KeyCacheObject> keyBytes = entry.getValue();
 
-            GridDhtUnlockRequest req = new GridDhtUnlockRequest(ctx.cacheId(), keyBytes.size());
+            GridDhtUnlockRequest req = new GridDhtUnlockRequest(ctx.cacheId(), keyBytes.size(),
+                ctx.deploymentEnabled());
 
             req.version(dhtVer);
 
@@ -1556,7 +1561,8 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
             if (!dhtMap.containsKey(n)) {
                 List<KeyCacheObject> keyBytes = entry.getValue();
 
-                GridDhtUnlockRequest req = new GridDhtUnlockRequest(ctx.cacheId(), keyBytes.size());
+                GridDhtUnlockRequest req = new GridDhtUnlockRequest(ctx.cacheId(), keyBytes.size(),
+                    ctx.deploymentEnabled());
 
                 req.version(dhtVer);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 79bccc2..992bd66 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -320,7 +320,8 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
                 tx.pendingVersions(),
                 tx.size(),
                 tx.subjectId(),
-                tx.taskNameHash());
+                tx.taskNameHash(),
+                tx.activeCachesDeploymentEnabled());
 
             try {
                 cctx.io().send(n, req, tx.ioPolicy());
@@ -397,7 +398,8 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
                 tx.pendingVersions(),
                 tx.size(),
                 tx.subjectId(),
-                tx.taskNameHash());
+                tx.taskNameHash(),
+                tx.activeCachesDeploymentEnabled());
 
             req.writeVersion(tx.writeVersion() != null ? tx.writeVersion() : tx.xidVersion());
 
@@ -450,7 +452,8 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
                     tx.pendingVersions(),
                     tx.size(),
                     tx.subjectId(),
-                    tx.taskNameHash());
+                    tx.taskNameHash(),
+                    tx.activeCachesDeploymentEnabled());
 
                 req.writeVersion(tx.writeVersion());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
index be59a95..caa0aa5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
@@ -104,6 +104,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
      * @param txSize Expected transaction size.
      * @param subjId Subject ID.
      * @param taskNameHash Task name hash.
+     * @param addDepInfo Deployment info flag.
      */
     public GridDhtTxFinishRequest(
         UUID nearNodeId,
@@ -127,7 +128,8 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
         Collection<GridCacheVersion> pendingVers,
         int txSize,
         @Nullable UUID subjId,
-        int taskNameHash
+        int taskNameHash,
+        boolean addDepInfo
     ) {
         super(
             xidVer,
@@ -143,7 +145,8 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
             baseVer,
             committedVers,
             rolledbackVers,
-            txSize);
+            txSize,
+            addDepInfo);
 
         assert miniId != null;
         assert nearNodeId != null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
index ec0f234..fb4d97d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
@@ -214,4 +214,4 @@ public class GridDhtTxFinishResponse extends GridDistributedTxFinishResponse {
     @Override public byte fieldsCount() {
         return 8;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 761bbb0..a15a334 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -670,7 +670,8 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
             tx.writeVersion(),
             ret,
             prepErr,
-            null);
+            null,
+            tx.activeCachesDeploymentEnabled());
 
         if (prepErr == null) {
             addDhtValues(res);
@@ -976,7 +977,8 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                         true,
                         tx.onePhaseCommit(),
                         tx.subjectId(),
-                        tx.taskNameHash());
+                        tx.taskNameHash(),
+                        tx.activeCachesDeploymentEnabled());
 
                     int idx = 0;
 
@@ -1075,7 +1077,8 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                             true,
                             tx.onePhaseCommit(),
                             tx.subjectId(),
-                            tx.taskNameHash());
+                            tx.taskNameHash(),
+                            tx.activeCachesDeploymentEnabled());
 
                         for (IgniteTxEntry entry : nearMapping.writes()) {
                             try {

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index 29d5a70..fcd66c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -29,6 +29,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.GridDirectCollection;
 import org.apache.ignite.internal.GridDirectTransient;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
 import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxPrepareRequest;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
@@ -116,7 +117,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
      * @param txNodes Transaction nodes mapping.
      * @param nearXidVer Near transaction ID.
      * @param last {@code True} if this is last prepare request for node.
-     * @param onePhaseCommit One phase commit flag.
+     * @param addDepInfo Deployment info flag.
      */
     public GridDhtTxPrepareRequest(
         IgniteUuid futId,
@@ -130,8 +131,9 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
         boolean last,
         boolean onePhaseCommit,
         UUID subjId,
-        int taskNameHash) {
-        super(tx, null, dhtWrites, txNodes, onePhaseCommit);
+        int taskNameHash,
+        boolean addDepInfo) {
+        super(tx, null, dhtWrites, txNodes, onePhaseCommit, addDepInfo);
 
         assert futId != null;
         assert miniId != null;
@@ -271,8 +273,11 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
         return owned;
     }
 
-    /** {@inheritDoc}
-     * @param ctx*/
+    /**
+     * {@inheritDoc}
+     *
+     * @param ctx
+     */
     @Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
         super.prepareMarshal(ctx);
 
@@ -281,12 +286,13 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
             ownedVals = owned.values();
 
-            for (IgniteTxKey key: ownedKeys)
-                key.prepareMarshal(ctx.cacheContext(key.cacheId()));
+            for (IgniteTxKey key: ownedKeys) {
+                GridCacheContext cctx = ctx.cacheContext(key.cacheId());
+
+                key.prepareMarshal(cctx);
 
-            if (ctx.deploymentEnabled()) {
-                for (IgniteTxKey k : owned.keySet())
-                    prepareObject(k, ctx);
+                if (addDepInfo)
+                    prepareObject(key, cctx);
             }
         }
 
@@ -551,4 +557,4 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
     @Override public byte fieldsCount() {
         return 35;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
index d903165..2eba9f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
@@ -84,9 +84,10 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
      * @param xid Xid version.
      * @param futId Future ID.
      * @param miniId Mini future ID.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridDhtTxPrepareResponse(GridCacheVersion xid, IgniteUuid futId, IgniteUuid miniId) {
-        super(xid);
+    public GridDhtTxPrepareResponse(GridCacheVersion xid, IgniteUuid futId, IgniteUuid miniId, boolean addDepInfo) {
+        super(xid, addDepInfo);
 
         assert futId != null;
         assert miniId != null;
@@ -100,9 +101,11 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
      * @param futId Future ID.
      * @param miniId Mini future ID.
      * @param err Error.
+     * @param addDepInfo Deployment enabled.
      */
-    public GridDhtTxPrepareResponse(GridCacheVersion xid, IgniteUuid futId, IgniteUuid miniId, Throwable err) {
-        super(xid, err);
+    public GridDhtTxPrepareResponse(GridCacheVersion xid, IgniteUuid futId, IgniteUuid miniId, Throwable err,
+        boolean addDepInfo) {
+        super(xid, err, addDepInfo);
 
         assert futId != null;
         assert miniId != null;
@@ -367,4 +370,4 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
     @Override public byte fieldsCount() {
         return 14;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
index e18dc33..38152a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
@@ -52,9 +52,10 @@ public class GridDhtUnlockRequest extends GridDistributedUnlockRequest {
     /**
      * @param cacheId Cache ID.
      * @param dhtCnt Key count.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridDhtUnlockRequest(int cacheId, int dhtCnt) {
-        super(cacheId, dhtCnt);
+    public GridDhtUnlockRequest(int cacheId, int dhtCnt, boolean addDepInfo) {
+        super(cacheId, dhtCnt, addDepInfo);
     }
 
     /**
@@ -157,4 +158,4 @@ public class GridDhtUnlockRequest extends GridDistributedUnlockRequest {
     @Override public byte fieldsCount() {
         return 9;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index abbe7b8..a68e834 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -409,7 +409,8 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
                     subjId,
                     taskName == null ? 0 : taskName.hashCode(),
                     expiryPlc != null ? expiryPlc.forAccess() : -1L,
-                    skipVals);
+                    skipVals,
+                    cctx.deploymentEnabled());
 
                 add(fut); // Append new future.
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 854a83d..cba6872 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1087,9 +1087,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         GridNearAtomicUpdateRequest req,
         CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb
     ) {
-        GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(ctx.cacheId(),
-            nodeId,
-            req.futureVersion());
+        GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(ctx.cacheId(), nodeId, req.futureVersion(),
+            ctx.deploymentEnabled());
 
         List<KeyCacheObject> keys = req.keys();
 
@@ -2480,7 +2479,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         GridCacheVersion ver = req.writeVersion();
 
         // Always send update reply.
-        GridDhtAtomicUpdateResponse res = new GridDhtAtomicUpdateResponse(ctx.cacheId(), req.futureVersion());
+        GridDhtAtomicUpdateResponse res = new GridDhtAtomicUpdateResponse(ctx.cacheId(), req.futureVersion(),
+            ctx.deploymentEnabled());
 
         Boolean replicate = ctx.isDrEnabled();
 
@@ -2936,7 +2936,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
          */
         private void finish() {
             GridDhtAtomicDeferredUpdateResponse msg = new GridDhtAtomicDeferredUpdateResponse(ctx.cacheId(),
-                respVers);
+                respVers, ctx.deploymentEnabled());
 
             try {
                 ctx.kernalContext().gateway().readLock();
@@ -2966,4 +2966,4 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
             pendingResponses.remove(nodeId, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java
index f3ecdb4..3a7bf1c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java
@@ -58,13 +58,21 @@ public class GridDhtAtomicDeferredUpdateResponse extends GridCacheMessage implem
     /**
      * Constructor.
      *
+     * @param cacheId Cache ID.
      * @param futVers Future versions.
+     * @param addDepInfo Deployment info.
      */
-    public GridDhtAtomicDeferredUpdateResponse(int cacheId, Collection<GridCacheVersion> futVers) {
+    public GridDhtAtomicDeferredUpdateResponse(int cacheId, Collection<GridCacheVersion> futVers, boolean addDepInfo) {
         assert !F.isEmpty(futVers);
 
         this.cacheId = cacheId;
         this.futVers = futVers;
+        this.addDepInfo = addDepInfo;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
     }
 
     /**
@@ -133,4 +141,4 @@ public class GridDhtAtomicDeferredUpdateResponse extends GridCacheMessage implem
     @Override public byte fieldsCount() {
         return 4;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 35b8e27..4ace5c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -233,7 +233,8 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
                         forceTransformBackups,
                         this.updateReq.subjectId(),
                         this.updateReq.taskNameHash(),
-                        forceTransformBackups ? this.updateReq.invokeArguments() : null);
+                        forceTransformBackups ? this.updateReq.invokeArguments() : null,
+                        cctx.deploymentEnabled());
 
                     mappings.put(nodeId, updateReq);
                 }
@@ -288,7 +289,8 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
                     forceTransformBackups,
                     this.updateReq.subjectId(),
                     this.updateReq.taskNameHash(),
-                    forceTransformBackups ? this.updateReq.invokeArguments() : null);
+                    forceTransformBackups ? this.updateReq.invokeArguments() : null,
+                    cctx.deploymentEnabled());
 
                 mappings.put(nodeId, updateReq);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index f5231ef..e55cac9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -159,6 +159,7 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
      * @param forceTransformBackups Force transform backups flag.
      * @param subjId Subject ID.
      * @param taskNameHash Task name hash code.
+     * @param addDepInfo Deployment info.
      */
     public GridDhtAtomicUpdateRequest(
         int cacheId,
@@ -170,7 +171,8 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
         boolean forceTransformBackups,
         UUID subjId,
         int taskNameHash,
-        Object[] invokeArgs
+        Object[] invokeArgs,
+        boolean addDepInfo
     ) {
         assert invokeArgs == null || forceTransformBackups;
 
@@ -184,6 +186,7 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
         this.subjId = subjId;
         this.taskNameHash = taskNameHash;
         this.invokeArgs = invokeArgs;
+        this.addDepInfo = addDepInfo;
 
         keys = new ArrayList<>();
 
@@ -546,13 +549,16 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
         prepareMarshalCacheObjects(nearVals, cctx);
 
         if (forceTransformBackups) {
-            invokeArgsBytes = marshalInvokeArguments(invokeArgs, ctx);
+            // force addition of deployment info for entry processors if P2P is enabled globally.
+            if (!addDepInfo && ctx.deploymentEnabled())
+                addDepInfo = true;
 
-            entryProcessorsBytes = marshalCollection(entryProcessors, ctx);
-        }
+            invokeArgsBytes = marshalInvokeArguments(invokeArgs, cctx);
 
-        if (forceTransformBackups)
-            nearEntryProcessorsBytes = marshalCollection(nearEntryProcessors, ctx);
+            entryProcessorsBytes = marshalCollection(entryProcessors, cctx);
+
+            nearEntryProcessorsBytes = marshalCollection(nearEntryProcessors, cctx);
+        }
     }
 
     /** {@inheritDoc} */
@@ -580,6 +586,11 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -913,4 +924,4 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
     @Override public String toString() {
         return S.toString(GridDhtAtomicUpdateRequest.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
index 04d36e5..f1bb323 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
@@ -77,10 +77,12 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements Gri
     /**
      * @param cacheId Cache ID.
      * @param futVer Future version.
+     * @param addDepInfo Deployment info.
      */
-    public GridDhtAtomicUpdateResponse(int cacheId, GridCacheVersion futVer) {
+    public GridDhtAtomicUpdateResponse(int cacheId, GridCacheVersion futVer, boolean addDepInfo) {
         this.cacheId = cacheId;
         this.futVer = futVer;
+        this.addDepInfo = addDepInfo;
     }
 
     /** {@inheritDoc} */
@@ -180,6 +182,11 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements Gri
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -285,4 +292,4 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements Gri
     @Override public String toString() {
         return S.toString(GridDhtAtomicUpdateResponse.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 97aa646..ae662c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -583,7 +583,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
                     req = mappings != null ? mappings.get(nodeId) : null;
 
                 if (req != null) {
-                    res = new GridNearAtomicUpdateResponse(cctx.cacheId(), nodeId, req.futureVersion());
+                    res = new GridNearAtomicUpdateResponse(cctx.cacheId(), nodeId, req.futureVersion(),
+                        cctx.deploymentEnabled());
 
                     ClusterTopologyCheckedException e = new ClusterTopologyCheckedException("Primary node left grid " +
                         "before response is received: " + nodeId);
@@ -794,7 +795,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
             synchronized (this) {
                 GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(cctx.cacheId(),
                     req.nodeId(),
-                    req.futureVersion());
+                    req.futureVersion(),
+                    cctx.deploymentEnabled());
 
                 res.addFailedKeys(req.keys(), e);
 
@@ -1048,7 +1050,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
                             subjId,
                             taskNameHash,
                             skipStore,
-                            cctx.kernalContext().clientNode());
+                            cctx.kernalContext().clientNode(),
+                            cctx.deploymentEnabled());
 
                         pendingMappings.put(nodeId, mapped);
                     }
@@ -1140,7 +1143,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
                 subjId,
                 taskNameHash,
                 skipStore,
-                cctx.kernalContext().clientNode());
+                cctx.kernalContext().clientNode(),
+                cctx.deploymentEnabled());
 
             req.addUpdateEntry(cacheKey,
                 val,

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index ccb67d2..33fa4bd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -178,6 +178,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
      * @param taskNameHash Task name hash code.
      * @param skipStore Skip write-through to a persistent storage.
      * @param clientReq Client node request flag.
+     * @param addDepInfo Deployment info flag.
      */
     public GridNearAtomicUpdateRequest(
         int cacheId,
@@ -196,7 +197,8 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
         @Nullable UUID subjId,
         int taskNameHash,
         boolean skipStore,
-        boolean clientReq
+        boolean clientReq,
+        boolean addDepInfo
     ) {
         assert futVer != null;
 
@@ -218,6 +220,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
         this.taskNameHash = taskNameHash;
         this.skipStore = skipStore;
         this.clientReq = clientReq;
+        this.addDepInfo = addDepInfo;
 
         keys = new ArrayList<>();
     }
@@ -538,11 +541,6 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
 
         prepareMarshalCacheObjects(keys, cctx);
 
-        if (op == TRANSFORM)
-            entryProcessorsBytes = marshalCollection(entryProcessors, ctx);
-        else
-            prepareMarshalCacheObjects(vals, cctx);
-
         if (filter != null) {
             boolean hasFilter = false;
 
@@ -558,10 +556,20 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
                 filter = null;
         }
 
-        invokeArgsBytes = marshalInvokeArguments(invokeArgs, ctx);
-
         if (expiryPlc != null)
-            expiryPlcBytes = CU.marshal(ctx, new IgniteExternalizableExpiryPolicy(expiryPlc));
+            expiryPlcBytes = CU.marshal(cctx, new IgniteExternalizableExpiryPolicy(expiryPlc));
+
+        if (op == TRANSFORM) {
+            // force addition of deployment info for entry processors if P2P is enabled globally.
+            if (!addDepInfo && ctx.deploymentEnabled())
+                addDepInfo = true;
+
+            entryProcessorsBytes = marshalCollection(entryProcessors, cctx);
+
+            invokeArgsBytes = marshalInvokeArguments(invokeArgs, cctx);
+        }
+        else
+            prepareMarshalCacheObjects(vals, cctx);
     }
 
     /** {@inheritDoc} */
@@ -591,6 +599,11 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -957,4 +970,4 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
         return S.toString(GridNearAtomicUpdateRequest.class, this, "filter", Arrays.toString(filter),
             "parent", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index 376f4ec..6536af3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -114,13 +114,15 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
      * @param cacheId Cache ID.
      * @param nodeId Node ID this reply should be sent to.
      * @param futVer Future version.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, GridCacheVersion futVer) {
+    public GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, GridCacheVersion futVer, boolean addDepInfo) {
         assert futVer != null;
 
         this.cacheId = cacheId;
         this.nodeId = nodeId;
         this.futVer = futVer;
+        this.addDepInfo = addDepInfo;
     }
 
     /** {@inheritDoc} */
@@ -428,6 +430,11 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -631,4 +638,4 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
     @Override public String toString() {
         return S.toString(GridNearAtomicUpdateResponse.class, this, "parent");
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index f38126d..6d69198 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -493,7 +493,8 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
                             GridNearUnlockRequest req = map.get(primary);
 
                             if (req == null) {
-                                map.put(primary, req = new GridNearUnlockRequest(ctx.cacheId(), keyCnt));
+                                map.put(primary, req = new GridNearUnlockRequest(ctx.cacheId(), keyCnt,
+                                    ctx.deploymentEnabled()));
 
                                 req.version(ver);
                             }
@@ -597,7 +598,8 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
                         GridNearUnlockRequest req = map.get(primary);
 
                         if (req == null) {
-                            map.put(primary, req = new GridNearUnlockRequest(ctx.cacheId(), keyCnt));
+                            map.put(primary, req = new GridNearUnlockRequest(ctx.cacheId(), keyCnt,
+                                ctx.deploymentEnabled()));
 
                             req.version(ver);
                         }
@@ -896,4 +898,4 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
     @Override public String toString() {
         return S.toString(GridDhtColocatedCache.class, this, super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index be09f54..53c2b63 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -849,7 +849,8 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture
                                         inTx() ? tx.taskNameHash() : 0,
                                         read ? accessTtl : -1L,
                                         skipStore,
-                                        clientFirst);
+                                        clientFirst,
+                                        cctx.deploymentEnabled());
 
                                     mapping.request(req);
                                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
index eaed424..bb78748 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
@@ -266,7 +266,8 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec
                         futId,
                         fut.miniId(),
                         mappedKeys,
-                        topVer);
+                        topVer,
+                        cctx.deploymentEnabled());
 
                     try {
                         add(fut); // Append new future.
@@ -588,4 +589,4 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec
             return S.toString(MiniFuture.class, this, super.toString());
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
index fac8b9b..15243d5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
@@ -59,18 +59,27 @@ public class GridDhtForceKeysRequest extends GridCacheMessage implements GridCac
     private AffinityTopologyVersion topVer;
 
     /**
+     * Required by {@link Externalizable}.
+     */
+    public GridDhtForceKeysRequest() {
+        // No-op.
+    }
+
+    /**
      * @param cacheId Cache ID.
      * @param futId Future ID.
      * @param miniId Mini-future ID.
      * @param keys Keys.
      * @param topVer Topology version.
+     * @param addDepInfo Deployment info.
      */
     GridDhtForceKeysRequest(
         int cacheId,
         IgniteUuid futId,
         IgniteUuid miniId,
         Collection<KeyCacheObject> keys,
-        AffinityTopologyVersion topVer
+        AffinityTopologyVersion topVer,
+        boolean addDepInfo
     ) {
         assert futId != null;
         assert miniId != null;
@@ -81,22 +90,7 @@ public class GridDhtForceKeysRequest extends GridCacheMessage implements GridCac
         this.miniId = miniId;
         this.keys = keys;
         this.topVer = topVer;
-    }
-
-    /**
-     * Required by {@link Externalizable}.
-     */
-    public GridDhtForceKeysRequest() {
-        // No-op.
-    }
-
-    /**
-     * @param keys Collection of keys.
-     */
-    public GridDhtForceKeysRequest(Collection<KeyCacheObject> keys) {
-        assert !F.isEmpty(keys);
-
-        this.keys = keys;
+        this.addDepInfo = addDepInfo;
     }
 
     /**
@@ -146,6 +140,11 @@ public class GridDhtForceKeysRequest extends GridCacheMessage implements GridCac
         finishUnmarshalCacheObjects(keys, cctx, ldr);
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
     /**
      * @return Key count.
      */
@@ -259,4 +258,4 @@ public class GridDhtForceKeysRequest extends GridCacheMessage implements GridCac
     @Override public String toString() {
         return S.toString(GridDhtForceKeysRequest.class, this, "keyCnt", keyCount(), "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
index 9418887..4cdecec 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
@@ -80,14 +80,16 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
      * @param cacheId Cache ID.
      * @param futId Request id.
      * @param miniId Mini-future ID.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridDhtForceKeysResponse(int cacheId, IgniteUuid futId, IgniteUuid miniId) {
+    public GridDhtForceKeysResponse(int cacheId, IgniteUuid futId, IgniteUuid miniId, boolean addDepInfo) {
         assert futId != null;
         assert miniId != null;
 
         this.cacheId = cacheId;
         this.futId = futId;
         this.miniId = miniId;
+        this.addDepInfo = addDepInfo;
     }
 
     /**
@@ -189,6 +191,11 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -308,4 +315,4 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
     @Override public String toString() {
         return S.toString(GridDhtForceKeysResponse.class, this, super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
index 848ad87..7609d98 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
@@ -189,6 +189,11 @@ public class GridDhtPartitionDemandMessage extends GridCacheMessage {
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
index 190946b..7a07f9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
@@ -78,14 +78,16 @@ public class GridDhtPartitionSupplyMessage extends GridCacheMessage implements G
      * @param workerId Worker ID.
      * @param updateSeq Update sequence for this node.
      * @param cacheId Cache ID.
+     * @param addDepInfo Deployment info flag.
      */
-    GridDhtPartitionSupplyMessage(int workerId, long updateSeq, int cacheId) {
+    GridDhtPartitionSupplyMessage(int workerId, long updateSeq, int cacheId, boolean addDepInfo) {
         assert workerId >= 0;
         assert updateSeq > 0;
 
         this.cacheId = cacheId;
         this.updateSeq = updateSeq;
         this.workerId = workerId;
+        this.addDepInfo = addDepInfo;
     }
 
     /**
@@ -258,6 +260,11 @@ public class GridDhtPartitionSupplyMessage extends GridCacheMessage implements G
         }
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
     /**
      * @return Number of entries in message.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
index fe328ef..28a73b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
@@ -253,7 +253,7 @@ class GridDhtPartitionSupplyPool {
             GridDhtPartitionDemandMessage d = msg.message();
 
             GridDhtPartitionSupplyMessage s = new GridDhtPartitionSupplyMessage(d.workerId(),
-                d.updateSequence(), cctx.cacheId());
+                d.updateSequence(), cctx.cacheId(), cctx.deploymentEnabled());
 
             long preloadThrottle = cctx.config().getRebalanceThrottle();
 
@@ -312,7 +312,7 @@ class GridDhtPartitionSupplyPool {
                                     U.sleep(preloadThrottle);
 
                                 s = new GridDhtPartitionSupplyMessage(d.workerId(), d.updateSequence(),
-                                    cctx.cacheId());
+                                    cctx.cacheId(), cctx.deploymentEnabled());
                             }
 
                             GridCacheEntryInfo info = e.info();
@@ -364,7 +364,7 @@ class GridDhtPartitionSupplyPool {
                                                 U.sleep(preloadThrottle);
 
                                             s = new GridDhtPartitionSupplyMessage(d.workerId(),
-                                                d.updateSequence(), cctx.cacheId());
+                                                d.updateSequence(), cctx.cacheId(), cctx.deploymentEnabled());
                                         }
 
                                         GridCacheSwapEntry swapEntry = e.getValue();
@@ -448,7 +448,7 @@ class GridDhtPartitionSupplyPool {
 
                                     s = new GridDhtPartitionSupplyMessage(d.workerId(),
                                         d.updateSequence(),
-                                        cctx.cacheId());
+                                        cctx.cacheId(), cctx.deploymentEnabled());
                                 }
 
                                 if (preloadPred == null || preloadPred.apply(info))
@@ -552,4 +552,4 @@ class GridDhtPartitionSupplyPool {
             return "DemandMessage [senderId=" + senderId() + ", msg=" + message() + ']';
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
index 041d5f0..4e714ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
@@ -56,6 +56,11 @@ abstract class GridDhtPartitionsAbstractMessage extends GridCacheMessage {
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean partitionExchangeMessage() {
         return true;
     }
@@ -142,4 +147,4 @@ abstract class GridDhtPartitionsAbstractMessage extends GridCacheMessage {
     @Override public String toString() {
         return S.toString(GridDhtPartitionsAbstractMessage.class, this, super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 74237f8..83867f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -372,7 +372,8 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
             GridDhtForceKeysResponse res = new GridDhtForceKeysResponse(
                 cctx.cacheId(),
                 msg.futureId(),
-                msg.miniId());
+                msg.miniId(),
+                cctx.deploymentEnabled());
 
             for (KeyCacheObject k : msg.keys()) {
                 int p = cctx.affinity().partition(k);

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index d9763f8..eca2f71 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
@@ -410,7 +410,8 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma
                     subjId,
                     taskName == null ? 0 : taskName.hashCode(),
                     expiryPlc != null ? expiryPlc.forAccess() : -1L,
-                    skipVals);
+                    skipVals,
+                    cctx.deploymentEnabled());
 
                 add(fut); // Append new future.
 
@@ -947,4 +948,4 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma
             return S.toString(MiniFuture.class, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
index 9bd2a68..ff6375a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
@@ -116,6 +116,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
      * @param subjId Subject ID.
      * @param taskNameHash Task name hash.
      * @param accessTtl New TTL to set after entry is accessed, -1 to leave unchanged.
+     * @param addDepInfo Deployment info.
      */
     public GridNearGetRequest(
         int cacheId,
@@ -129,7 +130,8 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
         UUID subjId,
         int taskNameHash,
         long accessTtl,
-        boolean skipVals
+        boolean skipVals,
+        boolean addDepInfo
     ) {
         assert futId != null;
         assert miniId != null;
@@ -149,6 +151,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
         this.taskNameHash = taskNameHash;
         this.accessTtl = accessTtl;
         this.skipVals = skipVals;
+        this.addDepInfo = addDepInfo;
     }
 
     /**
@@ -272,6 +275,11 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -490,4 +498,4 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
     @Override public String toString() {
         return S.toString(GridNearGetRequest.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
index d4493a2..fc06ab1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
@@ -90,12 +90,14 @@ public class GridNearGetResponse extends GridCacheMessage implements GridCacheDe
      * @param futId Future ID.
      * @param miniId Sub ID.
      * @param ver Version.
+     * @param addDepInfo Deployment info.
      */
     public GridNearGetResponse(
         int cacheId,
         IgniteUuid futId,
         IgniteUuid miniId,
-        GridCacheVersion ver
+        GridCacheVersion ver,
+        boolean addDepInfo
     ) {
         assert futId != null;
         assert miniId != null;
@@ -105,6 +107,7 @@ public class GridNearGetResponse extends GridCacheMessage implements GridCacheDe
         this.futId = futId;
         this.miniId = miniId;
         this.ver = ver;
+        this.addDepInfo = addDepInfo;
     }
 
     /**
@@ -207,6 +210,11 @@ public class GridNearGetResponse extends GridCacheMessage implements GridCacheDe
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -354,4 +362,4 @@ public class GridNearGetResponse extends GridCacheMessage implements GridCacheDe
     @Override public String toString() {
         return S.toString(GridNearGetResponse.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index e6b1e02..c5b55bd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -968,7 +968,8 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
                                             inTx() ? tx.taskNameHash() : 0,
                                             read ? accessTtl : -1L,
                                             skipStore,
-                                            clientFirst);
+                                            clientFirst,
+                                            cctx.deploymentEnabled());
 
                                         mapping.request(req);
                                     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
index 25ab297..165da84 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
@@ -121,6 +121,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
      * @param accessTtl TTL for read operation.
      * @param skipStore Skip store flag.
      * @param firstClientReq {@code True} if first lock request for lock operation sent from client node.
+     * @param addDepInfo Deployment info flag.
      */
     public GridNearLockRequest(
         int cacheId,
@@ -144,7 +145,9 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
         int taskNameHash,
         long accessTtl,
         boolean skipStore,
-        boolean firstClientReq
+        boolean firstClientReq,
+        boolean addDepInfo
+
     ) {
         super(
             cacheId,
@@ -160,7 +163,8 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
             timeout,
             keyCnt,
             txSize,
-            skipStore);
+            skipStore,
+            addDepInfo);
 
         assert topVer.compareTo(AffinityTopologyVersion.ZERO) > 0;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java
index 581061c..e48a098 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java
@@ -79,6 +79,7 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
      * @param cnt Count.
      * @param err Error.
      * @param clientRemapVer {@code True} if client node should remap lock request.
+     * @param addDepInfo Deployment info.
      */
     public GridNearLockResponse(
         int cacheId,
@@ -88,9 +89,10 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
         boolean filterRes,
         int cnt,
         Throwable err,
-        AffinityTopologyVersion clientRemapVer
+        AffinityTopologyVersion clientRemapVer,
+        boolean addDepInfo
     ) {
-        super(cacheId, lockVer, futId, cnt, err);
+        super(cacheId, lockVer, futId, cnt, err, addDepInfo);
 
         assert miniId != null;
 
@@ -325,4 +327,4 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
     @Override public String toString() {
         return S.toString(GridNearLockResponse.class, this, super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index 1fb33a2..6db00ab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -588,7 +588,8 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd
             m.explicitLock(),
             tx.subjectId(),
             tx.taskNameHash(),
-            m.clientFirst());
+            m.clientFirst(),
+            tx.activeCachesDeploymentEnabled());
 
         for (IgniteTxEntry txEntry : m.writes()) {
             if (txEntry.op() == TRANSFORM)

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
index b8d2250..62f9bb3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
@@ -207,7 +207,8 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
                 m.explicitLock(),
                 tx.subjectId(),
                 tx.taskNameHash(),
-                false);
+                false,
+                tx.activeCachesDeploymentEnabled());
 
             for (IgniteTxEntry txEntry : m.writes()) {
                 if (txEntry.op() == TRANSFORM)

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index e70c864..c3bb324 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -554,7 +554,8 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
                             GridNearUnlockRequest req = map.get(primary);
 
                             if (req == null) {
-                                map.put(primary, req = new GridNearUnlockRequest(ctx.cacheId(), keyCnt));
+                                map.put(primary, req = new GridNearUnlockRequest(ctx.cacheId(), keyCnt,
+                                    ctx.deploymentEnabled()));
 
                                 req.version(ver);
                             }
@@ -676,7 +677,8 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
                                     req = map.get(primary);
 
                                     if (req == null) {
-                                        map.put(primary, req = new GridNearUnlockRequest(ctx.cacheId(), keyCnt));
+                                        map.put(primary, req = new GridNearUnlockRequest(ctx.cacheId(), keyCnt,
+                                            ctx.deploymentEnabled()));
 
                                         req.version(ver);
                                     }
@@ -740,4 +742,4 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
     @Override public String toString() {
         return S.toString(GridNearTransactionalCache.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index 85311cc..1a4f130 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
@@ -452,7 +452,8 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
                         null,
                         0,
                         null,
-                        0);
+                        0,
+                        tx.activeCachesDeploymentEnabled());
 
                     finishReq.checkCommitted(true);
 
@@ -574,7 +575,8 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
             null,
             tx.size(),
             tx.subjectId(),
-            tx.taskNameHash()
+            tx.taskNameHash(),
+            tx.activeCachesDeploymentEnabled()
         );
 
         // If this is the primary node for the keys.
@@ -764,4 +766,4 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
             return S.toString(MiniFuture.class, this, "done", isDone(), "cancelled", isCancelled(), "err", error());
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
index c52a127..3e5e28f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
@@ -77,6 +77,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
      * @param committedVers Committed versions.
      * @param rolledbackVers Rolled back versions.
      * @param txSize Expected transaction size.
+     * @param addDepInfo Deployment info flag.
      */
     public GridNearTxFinishRequest(
         IgniteUuid futId,
@@ -96,7 +97,8 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
         Collection<GridCacheVersion> rolledbackVers,
         int txSize,
         @Nullable UUID subjId,
-        int taskNameHash) {
+        int taskNameHash,
+        boolean addDepInfo) {
         super(
             xidVer,
             futId,
@@ -111,7 +113,8 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
             baseVer,
             committedVers,
             rolledbackVers,
-            txSize
+            txSize,
+            addDepInfo
         );
 
         this.explicitLock = explicitLock;

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java
index c860baa..4904ad8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java
@@ -203,4 +203,4 @@ public class GridNearTxFinishResponse extends GridDistributedTxFinishResponse {
     @Override public String toString() {
         return S.toString(GridNearTxFinishResponse.class, this, "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
index 2b3ddff..456d726 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
@@ -107,6 +107,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
      * @param subjId Subject ID.
      * @param taskNameHash Task name hash.
      * @param firstClientReq {@code True} if first optimistic tx prepare request sent from client node.
+     * @param addDepInfo Deployment info flag.
      */
     public GridNearTxPrepareRequest(
         IgniteUuid futId,
@@ -124,9 +125,10 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
         boolean explicitLock,
         @Nullable UUID subjId,
         int taskNameHash,
-        boolean firstClientReq
+        boolean firstClientReq,
+        boolean addDepInfo
     ) {
-        super(tx, reads, writes, txNodes, onePhaseCommit);
+        super(tx, reads, writes, txNodes, onePhaseCommit, addDepInfo);
 
         assert futId != null;
         assert !firstClientReq || tx.optimistic() : tx;
@@ -492,4 +494,4 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
     @Override public String toString() {
         return S.toString(GridNearTxPrepareRequest.class, this, super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
index 6558f97..d886243 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
@@ -115,6 +115,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
      * @param retVal Return value.
      * @param err Error.
      * @param clientRemapVer Not {@code null} if client node should remap transaction.
+     * @param addDepInfo Deployment info flag.
      */
     public GridNearTxPrepareResponse(
         GridCacheVersion xid,
@@ -124,9 +125,10 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
         GridCacheVersion writeVer,
         GridCacheReturn retVal,
         Throwable err,
-        AffinityTopologyVersion clientRemapVer
+        AffinityTopologyVersion clientRemapVer,
+        boolean addDepInfo
     ) {
-        super(xid, err);
+        super(xid, err, addDepInfo);
 
         assert futId != null;
         assert miniId != null;
@@ -543,4 +545,4 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
         return S.toString(GridNearTxPrepareResponse.class, this, "super", super.toString());
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
index 821d504..7652a4a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
@@ -41,9 +41,10 @@ public class GridNearUnlockRequest extends GridDistributedUnlockRequest {
     /**
      * @param cacheId Cache ID.
      * @param keyCnt Key count.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridNearUnlockRequest(int cacheId, int keyCnt) {
-        super(cacheId, keyCnt);
+    public GridNearUnlockRequest(int cacheId, int keyCnt, boolean addDepInfo) {
+        super(cacheId, keyCnt, addDepInfo);
     }
 
     /** {@inheritDoc} */
@@ -90,4 +91,4 @@ public class GridNearUnlockRequest extends GridDistributedUnlockRequest {
     @Override public String toString() {
         return S.toString(GridNearUnlockRequest.class, this, super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableContext.java
index d064601..d5916e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableContext.java
@@ -41,13 +41,15 @@ public class CacheObjectPortableContext extends CacheObjectContext {
      * @param portableEnabled Portable enabled flag.
      * @param cpyOnGet Copy on get flag.
      * @param storeVal {@code True} if should store unmarshalled value in cache.
+     * @param depEnabled {@code true} if deployment is enabled for the given cache.
      */
     public CacheObjectPortableContext(GridKernalContext kernalCtx,
         boolean cpyOnGet,
         boolean storeVal,
-        boolean portableEnabled) {
+        boolean portableEnabled,
+        boolean depEnabled) {
         super(kernalCtx, portableEnabled ? new CacheDefaultPortableAffinityKeyMapper() :
-            new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal);
+            new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled);
 
         this.portableEnabled = portableEnabled;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
index 4cab3db..2de9d84 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
@@ -704,7 +704,8 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
         CacheObjectContext res = new CacheObjectPortableContext(ctx,
             ctx0.copyOnGet(),
             ctx0.storeValue(),
-            portableEnabled);
+            portableEnabled,
+            ctx0.addDeploymentInfo());
 
         ctx.resource().injectGeneric(res.defaultAffMapper());
 
@@ -1022,4 +1023,4 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
             return S.toString(MetaDataPredicate.class, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
index e745e30..6110e0c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
@@ -102,7 +102,8 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
             final GridCacheQueryRequest req = new GridCacheQueryRequest(cctx.cacheId(),
                 reqId,
                 fields(),
-                qryMgr.queryTopologyVersion());
+                qryMgr.queryTopologyVersion(),
+                cctx.deploymentEnabled());
 
             // Process cancel query directly (without sending) for local node,
             cctx.closures().callLocalSafe(new Callable<Object>() {
@@ -275,4 +276,4 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
 
         qryMgr.removeQueryFuture(reqId);
     }
-}
\ No newline at end of file
+}


[08/16] ignite git commit: IGNITE-1701. Bump Spark dependenency to 1.5.1 (the latest stable)

Posted by dm...@apache.org.
IGNITE-1701. Bump Spark dependenency to 1.5.1 (the latest stable)


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

Branch: refs/heads/ignite-801
Commit: 1334e77a7eb23d575de9097f519a64b4678e9dff
Parents: ef785cb
Author: Konstantin Boudnik <co...@wandisco.com>
Authored: Thu Oct 15 14:26:47 2015 -0700
Committer: Konstantin Boudnik <co...@wandisco.com>
Committed: Mon Oct 26 13:13:56 2015 -0700

----------------------------------------------------------------------
 DEVNOTES.txt               | 3 ++-
 modules/spark-2.10/pom.xml | 4 ++--
 modules/spark/pom.xml      | 4 ++--
 parent/pom.xml             | 1 +
 4 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1334e77a/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index e8e3741..ea9cf17 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -19,9 +19,10 @@ NOTE: JDK version should be 1.7.0-* or >= 1.8.0-u40.
 
 Ignite Hadoop Accelerator Maven Build Instructions
 ============================================
-mvn clean package -DskipTests -Dignite.edition=hadoop [-Dhadoop.version=X.X.X]
+mvn clean package -DskipTests -Dignite.edition=hadoop [-Dhadoop.version=X.X.X] [-Dspark.version=x.y.z]
 
 Use 'hadoop.version' parameter to build Ignite against a specific Hadoop version.
+Use 'spark.version' parameter to build ignite-spark module for a specific Spark version.
 
 Look for apache-ignite-hadoop-<version>-bin.zip in ./target/bin directory. Resulting binary
 assembly will also include integration module for Apache Spark.

http://git-wip-us.apache.org/repos/asf/ignite/blob/1334e77a/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 316b13b..4697693 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -58,13 +58,13 @@
         <dependency>
             <groupId>org.apache.spark</groupId>
             <artifactId>spark-core_2.10</artifactId>
-            <version>1.3.1</version>
+            <version>${spark.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.spark</groupId>
             <artifactId>spark-sql_2.10</artifactId>
-            <version>1.3.1</version>
+            <version>${spark.version}</version>
         </dependency>
 
         <!-- Test dependencies -->

http://git-wip-us.apache.org/repos/asf/ignite/blob/1334e77a/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index 95e05d8..942652c 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -58,13 +58,13 @@
         <dependency>
             <groupId>org.apache.spark</groupId>
             <artifactId>spark-core_2.11</artifactId>
-            <version>1.3.1</version>
+            <version>${spark.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.spark</groupId>
             <artifactId>spark-sql_2.11</artifactId>
-            <version>1.3.1</version>
+            <version>${spark.version}</version>
         </dependency>
 
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/1334e77a/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index ba44c85..765ecf1 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -36,6 +36,7 @@
     <properties>
         <ignite.edition>fabric</ignite.edition>
         <hadoop.version>2.4.1</hadoop.version>
+        <spark.version>1.5.1</spark.version>
         <spring.version>4.1.0.RELEASE</spring.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.build.timestamp.format>MMMM d yyyy</maven.build.timestamp.format>


[07/16] ignite git commit: IGNITE-1203 Add Zookeeper IP Finder test suite.

Posted by dm...@apache.org.
IGNITE-1203 Add Zookeeper IP Finder test suite.


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

Branch: refs/heads/ignite-801
Commit: ef785cb2cd8528ef99f101924da85837a0d5dbb2
Parents: ea63c2d
Author: Raul Kripalani <ra...@apache.org>
Authored: Mon Oct 26 16:35:29 2015 +0000
Committer: Raul Kripalani <ra...@apache.org>
Committed: Mon Oct 26 16:35:29 2015 +0000

----------------------------------------------------------------------
 .../ipfinder/zk/ZookeeperIpFinderTestSuite.java | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ef785cb2/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTestSuite.java b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTestSuite.java
new file mode 100644
index 0000000..a5b6d8f
--- /dev/null
+++ b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTestSuite.java
@@ -0,0 +1,32 @@
+/*
+ * 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.spi.discovery.tcp.ipfinder.zk;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Zookeeper IP Finder tests.
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    ZookeeperIpFinderTest.class
+})
+public class ZookeeperIpFinderTestSuite {
+
+}


[12/16] ignite git commit: ignite-1272: support of custom class loaders and conditional deployment info for portable marshaller and portable caches

Posted by dm...@apache.org.
ignite-1272: support of custom class loaders and conditional deployment info for portable marshaller and portable caches


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

Branch: refs/heads/ignite-801
Commit: df931bd09d0a18af839c8d122853111488c1a294
Parents: 18fb46e
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Oct 27 12:32:02 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Oct 27 12:32:08 2015 +0300

----------------------------------------------------------------------
 .../internal/GridEventConsumeHandler.java       |  19 +-
 .../deployment/GridDeploymentLocalStore.java    |   8 +-
 .../GridDeploymentPerLoaderStore.java           |   8 +-
 .../GridDeploymentPerVersionStore.java          |   8 +-
 .../internal/portable/PortableContext.java      |  91 +++++---
 .../portable/api/PortableMarshaller.java        |   5 +
 .../processors/cache/CacheObjectContext.java    |  17 +-
 .../processors/cache/GridCacheContext.java      |  10 +-
 .../cache/GridCacheEvictionManager.java         |   5 +-
 .../cache/GridCacheEvictionRequest.java         |  18 +-
 .../cache/GridCacheEvictionResponse.java        |   7 +-
 .../processors/cache/GridCacheIoManager.java    |  34 +--
 .../processors/cache/GridCacheMessage.java      |  72 +++++--
 .../cache/GridCacheSharedContext.java           |   3 +
 .../processors/cache/GridCacheUtils.java        |  20 +-
 .../distributed/GridCacheTtlUpdateRequest.java  |   7 +-
 .../distributed/GridCacheTxRecoveryFuture.java  |   9 +-
 .../distributed/GridCacheTxRecoveryRequest.java |   8 +-
 .../GridCacheTxRecoveryResponse.java            |  10 +-
 .../distributed/GridDistributedBaseMessage.java |  16 +-
 .../distributed/GridDistributedLockRequest.java |   8 +-
 .../GridDistributedLockResponse.java            |  20 +-
 .../GridDistributedTxFinishRequest.java         |   6 +-
 .../GridDistributedTxFinishResponse.java        |   7 +-
 .../GridDistributedTxPrepareRequest.java        |  13 +-
 .../GridDistributedTxPrepareResponse.java       |  12 +-
 .../GridDistributedTxRemoteAdapter.java         |   5 +
 .../GridDistributedUnlockRequest.java           |   7 +-
 .../dht/GridDhtAffinityAssignmentRequest.java   |   7 +-
 .../dht/GridDhtAffinityAssignmentResponse.java  |   7 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |   3 +-
 .../distributed/dht/GridDhtLockFuture.java      |   5 +-
 .../distributed/dht/GridDhtLockRequest.java     |   7 +-
 .../distributed/dht/GridDhtLockResponse.java    |  14 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |  22 +-
 .../distributed/dht/GridDhtTxFinishFuture.java  |   9 +-
 .../distributed/dht/GridDhtTxFinishRequest.java |   7 +-
 .../dht/GridDhtTxFinishResponse.java            |   2 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |   9 +-
 .../dht/GridDhtTxPrepareRequest.java            |  28 ++-
 .../dht/GridDhtTxPrepareResponse.java           |  13 +-
 .../distributed/dht/GridDhtUnlockRequest.java   |   7 +-
 .../dht/GridPartitionedGetFuture.java           |   3 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  12 +-
 .../GridDhtAtomicDeferredUpdateResponse.java    |  12 +-
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |   6 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |  25 ++-
 .../dht/atomic/GridDhtAtomicUpdateResponse.java |  11 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  12 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java |  33 ++-
 .../atomic/GridNearAtomicUpdateResponse.java    |  11 +-
 .../dht/colocated/GridDhtColocatedCache.java    |   8 +-
 .../colocated/GridDhtColocatedLockFuture.java   |   3 +-
 .../dht/preloader/GridDhtForceKeysFuture.java   |   5 +-
 .../dht/preloader/GridDhtForceKeysRequest.java  |  35 ++-
 .../dht/preloader/GridDhtForceKeysResponse.java |  11 +-
 .../GridDhtPartitionDemandMessage.java          |   5 +
 .../GridDhtPartitionSupplyMessage.java          |   9 +-
 .../preloader/GridDhtPartitionSupplyPool.java   |  10 +-
 .../GridDhtPartitionsAbstractMessage.java       |   7 +-
 .../dht/preloader/GridDhtPreloader.java         |   3 +-
 .../distributed/near/GridNearGetFuture.java     |   5 +-
 .../distributed/near/GridNearGetRequest.java    |  12 +-
 .../distributed/near/GridNearGetResponse.java   |  12 +-
 .../distributed/near/GridNearLockFuture.java    |   3 +-
 .../distributed/near/GridNearLockRequest.java   |   8 +-
 .../distributed/near/GridNearLockResponse.java  |   8 +-
 .../near/GridNearOptimisticTxPrepareFuture.java |   3 +-
 .../GridNearPessimisticTxPrepareFuture.java     |   3 +-
 .../near/GridNearTransactionalCache.java        |   8 +-
 .../near/GridNearTxFinishFuture.java            |   8 +-
 .../near/GridNearTxFinishRequest.java           |   7 +-
 .../near/GridNearTxFinishResponse.java          |   2 +-
 .../near/GridNearTxPrepareRequest.java          |   8 +-
 .../near/GridNearTxPrepareResponse.java         |   8 +-
 .../distributed/near/GridNearUnlockRequest.java |   7 +-
 .../portable/CacheObjectPortableContext.java    |   6 +-
 .../CacheObjectPortableProcessorImpl.java       |   5 +-
 .../query/GridCacheDistributedQueryFuture.java  |   5 +-
 .../query/GridCacheDistributedQueryManager.java |  25 ++-
 .../cache/query/GridCacheQueryRequest.java      |  46 ++--
 .../cache/query/GridCacheQueryResponse.java     |  29 ++-
 .../continuous/CacheContinuousQueryHandler.java |   8 +-
 .../cache/transactions/IgniteInternalTx.java    |   8 +-
 .../cache/transactions/IgniteTxAdapter.java     |   5 +
 .../cache/transactions/IgniteTxEntry.java       |   8 +-
 .../cache/transactions/IgniteTxHandler.java     |  16 +-
 .../transactions/IgniteTxLocalAdapter.java      |  11 +
 .../IgniteCacheObjectProcessorImpl.java         |   7 +-
 .../ignite/marshaller/AbstractMarshaller.java   |  12 +-
 .../ignite/marshaller/jdk/JdkMarshaller.java    |   7 +-
 .../optimized/OptimizedMarshaller.java          |   4 +-
 ...eAtomicEntryProcessorDeploymentSelfTest.java | 211 +++++++++++++++++++
 .../GridCacheConditionalDeploymentSelfTest.java | 190 +++++++++++++++++
 .../GridCacheDeploymentOffHeapSelfTest.java     |  17 +-
 .../cache/GridCacheDeploymentSelfTest.java      |  26 +--
 ...ctionalEntryProcessorDeploymentSelfTest.java |  31 +++
 .../communication/GridCacheMessageSelfTest.java |  17 +-
 .../ignite/testsuites/IgniteBasicTestSuite.java |   4 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |  18 +-
 .../testsuites/IgniteCacheTestSuite3.java       |   8 +-
 .../testsuites/IgniteP2PSelfTestSuite.java      |  16 +-
 .../p2p/CacheDeploymentEntryProcessor.java      |  35 +++
 .../CacheDeploymentPortableEntryProcessor.java  |  35 +++
 104 files changed, 1332 insertions(+), 394 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/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 599d301..b4ce4ab 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
@@ -35,6 +35,7 @@ import org.apache.ignite.internal.managers.deployment.GridDeploymentInfo;
 import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoBean;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
 import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheDeployable;
 import org.apache.ignite.internal.processors.cache.GridCacheDeploymentManager;
 import org.apache.ignite.internal.processors.continuous.GridContinuousHandler;
@@ -197,16 +198,18 @@ class GridEventConsumeHandler implements GridContinuousHandler {
                                                     if (node == null)
                                                         continue;
 
-                                                    if (ctx.config().isPeerClassLoadingEnabled()
-                                                        && ctx.discovery().cacheNode(node, cacheName)) {
-                                                        wrapper.p2pMarshal(ctx.config().getMarshaller());
+                                                    if (ctx.config().isPeerClassLoadingEnabled()) {
+                                                        GridCacheContext cctx =
+                                                            ctx.cache().internalCache(cacheName).context();
 
-                                                        wrapper.cacheName = cacheName;
+                                                        if (cctx.deploymentEnabled() &&
+                                                            ctx.discovery().cacheNode(node, cacheName)) {
+                                                            wrapper.p2pMarshal(ctx.config().getMarshaller());
 
-                                                        GridCacheDeploymentManager depMgr = ctx.cache()
-                                                            .internalCache(cacheName).context().deploy();
+                                                            wrapper.cacheName = cacheName;
 
-                                                        depMgr.prepare(wrapper);
+                                                            cctx.deploy().prepare(wrapper);
+                                                        }
                                                     }
                                                 }
 
@@ -519,4 +522,4 @@ class GridEventConsumeHandler implements GridContinuousHandler {
                 evt = (Event)in.readObject();
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
index 420eea8..d095efb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java
@@ -39,7 +39,7 @@ import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;
-import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
+import org.apache.ignite.marshaller.AbstractMarshaller;
 import org.apache.ignite.spi.IgniteSpiException;
 import org.apache.ignite.spi.deployment.DeploymentListener;
 import org.apache.ignite.spi.deployment.DeploymentResource;
@@ -541,8 +541,8 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
                 ctx.resource().onUndeployed(dep);
 
                 // Clear optimized marshaller's cache.
-                if (ctx.config().getMarshaller() instanceof OptimizedMarshaller)
-                    ((OptimizedMarshaller)ctx.config().getMarshaller()).onUndeploy(ldr);
+                if (ctx.config().getMarshaller() instanceof AbstractMarshaller)
+                    ((AbstractMarshaller)ctx.config().getMarshaller()).onUndeploy(ldr);
 
                 clearSerializationCaches();
 
@@ -572,4 +572,4 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter {
             undeploy(ldr);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerLoaderStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerLoaderStore.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerLoaderStore.java
index 6ca74eb..4ba308c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerLoaderStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerLoaderStore.java
@@ -39,7 +39,7 @@ import org.apache.ignite.internal.util.GridClassLoaderCache;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;
-import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
+import org.apache.ignite.marshaller.AbstractMarshaller;
 import org.apache.ignite.spi.deployment.DeploymentSpi;
 
 import static org.apache.ignite.events.EventType.EVT_CLASS_DEPLOYED;
@@ -511,8 +511,8 @@ public class GridDeploymentPerLoaderStore extends GridDeploymentStoreAdapter {
                 ctx.cache().onUndeployed(ldr);
 
                 // Clear optimized marshaller's cache.
-                if (ctx.config().getMarshaller() instanceof OptimizedMarshaller)
-                    ((OptimizedMarshaller)ctx.config().getMarshaller()).onUndeploy(ldr);
+                if (ctx.config().getMarshaller() instanceof AbstractMarshaller)
+                    ((AbstractMarshaller)ctx.config().getMarshaller()).onUndeploy(ldr);
 
                 clearSerializationCaches();
 
@@ -527,4 +527,4 @@ public class GridDeploymentPerLoaderStore extends GridDeploymentStoreAdapter {
             return S.toString(IsolatedDeployment.class, this, super.toString());
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java
index 6f9e968..fabbcb2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java
@@ -46,7 +46,7 @@ import org.apache.ignite.internal.util.typedef.internal.LT;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;
-import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
+import org.apache.ignite.marshaller.AbstractMarshaller;
 import org.apache.ignite.spi.deployment.DeploymentSpi;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
@@ -1281,8 +1281,8 @@ public class GridDeploymentPerVersionStore extends GridDeploymentStoreAdapter {
                 ctx.cache().onUndeployed(ldr);
 
                 // Clear optimized marshaller's cache.
-                if (ctx.config().getMarshaller() instanceof OptimizedMarshaller)
-                    ((OptimizedMarshaller)ctx.config().getMarshaller()).onUndeploy(ldr);
+                if (ctx.config().getMarshaller() instanceof AbstractMarshaller)
+                    ((AbstractMarshaller)ctx.config().getMarshaller()).onUndeploy(ldr);
 
                 clearSerializationCaches();
 
@@ -1297,4 +1297,4 @@ public class GridDeploymentPerVersionStore extends GridDeploymentStoreAdapter {
             return S.toString(SharedDeployment.class, this, "super", super.toString());
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
index e9cccf0..acd6a56 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
@@ -52,24 +52,25 @@ import java.util.jar.JarFile;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.portable.api.PortableException;
+import org.apache.ignite.internal.portable.api.PortableIdMapper;
+import org.apache.ignite.internal.portable.api.PortableInvalidClassException;
+import org.apache.ignite.internal.portable.api.PortableMarshaller;
+import org.apache.ignite.internal.portable.api.PortableMetadata;
+import org.apache.ignite.internal.portable.api.PortableSerializer;
+import org.apache.ignite.internal.portable.api.PortableTypeConfiguration;
 import org.apache.ignite.internal.processors.cache.portable.CacheObjectPortableProcessorImpl;
+import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfiguration;
+import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetPortableConfiguration;
+import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetPortableTypeConfiguration;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
+import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.lang.GridMapEntry;
 import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.marshaller.MarshallerContext;
 import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
-import org.apache.ignite.internal.portable.api.PortableMarshaller;
-import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfiguration;
-import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetPortableConfiguration;
-import org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetPortableTypeConfiguration;
-import org.apache.ignite.internal.portable.api.PortableException;
-import org.apache.ignite.internal.portable.api.PortableIdMapper;
-import org.apache.ignite.internal.portable.api.PortableInvalidClassException;
-import org.apache.ignite.internal.portable.api.PortableMetadata;
-import org.apache.ignite.internal.portable.api.PortableSerializer;
-import org.apache.ignite.internal.portable.api.PortableTypeConfiguration;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
@@ -81,6 +82,9 @@ public class PortableContext implements Externalizable {
     private static final long serialVersionUID = 0L;
 
     /** */
+    private static final ClassLoader dfltLdr = U.gridClassLoader();
+
+    /** */
     static final PortableIdMapper DFLT_ID_MAPPER = new IdMapperWrapper(null);
 
     /** */
@@ -108,8 +112,8 @@ public class PortableContext implements Externalizable {
     /** */
     private final ConcurrentMap<Class<?>, PortableClassDescriptor> descByCls = new ConcurrentHashMap8<>();
 
-    /** */
-    private final ConcurrentMap<Integer, PortableClassDescriptor> userTypes = new ConcurrentHashMap8<>(0);
+    /** Holds classes loaded by default class loader only. */
+    private final ConcurrentMap<Integer, PortableClassDescriptor> userTypes = new ConcurrentHashMap8<>();
 
     /** */
     private final Map<Integer, PortableClassDescriptor> predefinedTypes = new HashMap<>();
@@ -124,7 +128,7 @@ public class PortableContext implements Externalizable {
     private final Map<Class<? extends Map>, Byte> mapTypes = new HashMap<>();
 
     /** */
-    private final Map<Integer, PortableIdMapper> mappers = new ConcurrentHashMap8<>(0);
+    private final ConcurrentMap<Integer, PortableIdMapper> mappers = new ConcurrentHashMap8<>(0);
 
     /** */
     private final Map<String, PortableIdMapper> typeMappers = new ConcurrentHashMap8<>(0);
@@ -454,16 +458,18 @@ public class PortableContext implements Externalizable {
     public PortableClassDescriptor descriptorForTypeId(boolean userType, int typeId, ClassLoader ldr) {
         assert typeId != GridPortableMarshaller.UNREGISTERED_TYPE_ID;
 
-        //TODO: IGNITE-1358 (uncomment when fixed)
-        //PortableClassDescriptor desc = userType ? userTypes.get(typeId) : predefinedTypes.get(typeId);
-
-        // As a workaround for IGNITE-1358 we always check the predefined map before.
+        //TODO: As a workaround for IGNITE-1358 we always check the predefined map before without checking 'userType'
         PortableClassDescriptor desc = predefinedTypes.get(typeId);
 
         if (desc != null)
             return desc;
 
-        if (userType) {
+        if (ldr == null)
+            ldr = dfltLdr;
+
+        // If the type hasn't been loaded by default class loader then we mustn't return the descriptor from here
+        // giving a chance to a custom class loader to reload type's class.
+        if (userType && ldr.equals(dfltLdr)) {
             desc = userTypes.get(typeId);
 
             if (desc != null)
@@ -478,9 +484,17 @@ public class PortableContext implements Externalizable {
             desc = descByCls.get(cls);
         }
         catch (ClassNotFoundException e) {
+            // Class might have been loaded by default class loader.
+            if (userType && !ldr.equals(dfltLdr) && (desc = descriptorForTypeId(true, typeId, dfltLdr)) != null)
+                return desc;
+
             throw new PortableInvalidClassException(e);
         }
         catch (IgniteCheckedException e) {
+            // Class might have been loaded by default class loader.
+            if (userType && !ldr.equals(dfltLdr) && (desc = descriptorForTypeId(true, typeId, dfltLdr)) != null)
+                return desc;
+
             throw new PortableException("Failed resolve class for ID: " + typeId, e);
         }
 
@@ -541,7 +555,7 @@ public class PortableContext implements Externalizable {
 
         String typeName = typeName(cls.getName());
 
-        PortableIdMapper idMapper = idMapper(typeName);
+        PortableIdMapper idMapper = userTypeIdMapper(typeName);
 
         int typeId = idMapper.typeId(typeName);
 
@@ -566,10 +580,15 @@ public class PortableContext implements Externalizable {
             false /* predefined */
         );
 
-        // perform put() instead of putIfAbsent() because "registered" flag may have been changed.
-        userTypes.put(typeId, desc);
+        // perform put() instead of putIfAbsent() because "registered" flag might have been changed or class loader
+        // might have reloaded described class.
+        if (IgniteUtils.detectClassLoader(cls).equals(dfltLdr))
+            userTypes.put(typeId, desc);
+
         descByCls.put(cls, desc);
 
+        mappers.putIfAbsent(typeId, idMapper);
+
         // TODO uncomment for https://issues.apache.org/jira/browse/IGNITE-1377
 //        if (registerMetadata && isMetaDataEnabled(typeId))
 //            metaHnd.addMeta(typeId, new PortableMetaDataImpl(typeName, desc.fieldsMeta(), null));
@@ -619,7 +638,7 @@ public class PortableContext implements Externalizable {
         if (marshCtx.isSystemType(typeName))
             return typeName.hashCode();
 
-        return idMapper(shortTypeName).typeId(shortTypeName);
+        return userTypeIdMapper(shortTypeName).typeId(shortTypeName);
     }
 
     /**
@@ -628,20 +647,20 @@ public class PortableContext implements Externalizable {
      * @return Field ID.
      */
     public int fieldId(int typeId, String fieldName) {
-        return idMapper(typeId).fieldId(typeId, fieldName);
+        return userTypeIdMapper(typeId).fieldId(typeId, fieldName);
     }
 
     /**
      * @param typeId Type ID.
      * @return Instance of ID mapper.
      */
-    public PortableIdMapper idMapper(int typeId) {
+    public PortableIdMapper userTypeIdMapper(int typeId) {
         PortableIdMapper idMapper = mappers.get(typeId);
 
         if (idMapper != null)
             return idMapper;
 
-        if (userTypes.containsKey(typeId) || predefinedTypes.containsKey(typeId))
+        if (predefinedTypes.containsKey(typeId))
             return DFLT_ID_MAPPER;
 
         return BASIC_CLS_ID_MAPPER;
@@ -651,7 +670,7 @@ public class PortableContext implements Externalizable {
      * @param typeName Type name.
      * @return Instance of ID mapper.
      */
-    private PortableIdMapper idMapper(String typeName) {
+    private PortableIdMapper userTypeIdMapper(String typeName) {
         PortableIdMapper idMapper = typeMappers.get(typeName);
 
         return idMapper != null ? idMapper : DFLT_ID_MAPPER;
@@ -784,7 +803,9 @@ public class PortableContext implements Externalizable {
 
             fieldsMeta = desc.fieldsMeta();
 
-            userTypes.put(id, desc);
+            if (IgniteUtils.detectClassLoader(cls).equals(dfltLdr))
+                userTypes.put(id, desc);
+
             descByCls.put(cls, desc);
         }
 
@@ -934,6 +955,22 @@ public class PortableContext implements Externalizable {
     }
 
     /**
+     * Undeployment callback invoked when class loader is being undeployed.
+     *
+     * Some marshallers may want to clean their internal state that uses the undeployed class loader somehow.
+     *
+     * @param ldr Class loader being undeployed.
+     */
+    public void onUndeploy(ClassLoader ldr) {
+        for (Class<?> cls : descByCls.keySet()) {
+            if (ldr.equals(cls.getClassLoader()))
+                descByCls.remove(cls);
+        }
+
+        U.clearClassCache(ldr);
+    }
+
+    /**
      */
     private static class IdMapperWrapper implements PortableIdMapper {
         /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java
index 3dfbdf0..24a39a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java
@@ -349,4 +349,9 @@ public class PortableMarshaller extends AbstractMarshaller {
             throw new PortableException("Failed to unmarshal the object from InputStream", e);
         }
     }
+
+    /** {@inheritDoc} */
+    @Override public void onUndeploy(ClassLoader ldr) {
+        impl.context().onUndeploy(ldr);
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
index 7d7cbec..44b91a5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
@@ -44,21 +44,27 @@ public class CacheObjectContext {
     /** */
     private boolean p2pEnabled;
 
+    /** */
+    private boolean addDepInfo;
+
     /**
      * @param kernalCtx Kernal context.
      * @param dfltAffMapper Default affinity mapper.
      * @param cpyOnGet Copy on get flag.
      * @param storeVal {@code True} if should store unmarshalled value in cache.
+     * @param addDepInfo {@code true} if deployment info should be associated with the objects of this cache.
      */
     public CacheObjectContext(GridKernalContext kernalCtx,
         AffinityKeyMapper dfltAffMapper,
         boolean cpyOnGet,
-        boolean storeVal) {
+        boolean storeVal,
+        boolean addDepInfo) {
         this.kernalCtx = kernalCtx;
         this.p2pEnabled = kernalCtx.config().isPeerClassLoadingEnabled();
         this.dfltAffMapper = dfltAffMapper;
         this.cpyOnGet = cpyOnGet;
         this.storeVal = storeVal;
+        this.addDepInfo = addDepInfo;
 
         proc = kernalCtx.cacheObjects();
     }
@@ -71,6 +77,13 @@ public class CacheObjectContext {
     }
 
     /**
+     * @return {@code True} if deployment info should be associated with the objects of this cache.
+     */
+    public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
+    /**
      * @return Copy on get flag.
      */
     public boolean copyOnGet() {
@@ -126,4 +139,4 @@ public class CacheObjectContext {
     public Collection<Object> unwrapPortablesIfNeeded(Collection<Object> col, boolean keepPortable) {
         return col;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 3a1cee6..1f4852c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -236,6 +236,9 @@ public class GridCacheContext<K, V> implements Externalizable {
     /** Updates allowed flag. */
     private boolean updatesAllowed;
 
+    /** Deployment enabled flag for this specific cache */
+    private boolean depEnabled;
+
     /**
      * Empty constructor required for {@link Externalizable}.
      */
@@ -312,6 +315,7 @@ public class GridCacheContext<K, V> implements Externalizable {
         this.cacheType = cacheType;
         this.affNode = affNode;
         this.updatesAllowed = updatesAllowed;
+        this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg);
 
         /*
          * Managers in starting order!
@@ -965,7 +969,7 @@ public class GridCacheContext<K, V> implements Externalizable {
      * @return Cache transaction manager.
      */
     public IgniteTxManager tm() {
-         return sharedCtx.tm();
+        return sharedCtx.tm();
     }
 
     /**
@@ -1408,10 +1412,10 @@ public class GridCacheContext<K, V> implements Externalizable {
     }
 
     /**
-     * @return {@code True} if deployment enabled.
+     * @return {@code True} if deployment is enabled.
      */
     public boolean deploymentEnabled() {
-        return ctx.deploy().enabled();
+        return depEnabled;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 1c34c76..9a89fee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -1742,7 +1742,8 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
                         // There are remote participants.
                         for (ClusterNode node : nodes) {
                             GridCacheEvictionRequest req = F.addIfAbsent(reqMap, node.id(),
-                                new GridCacheEvictionRequest(cctx.cacheId(), id, evictInfos.size(), topVer));
+                                new GridCacheEvictionRequest(cctx.cacheId(), id, evictInfos.size(), topVer,
+                                    cctx.deploymentEnabled()));
 
                             assert req != null;
 
@@ -2106,4 +2107,4 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
             return S.toString(EvictionFuture.class, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
index fa0359c..09652a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
@@ -62,14 +62,17 @@ public class GridCacheEvictionRequest extends GridCacheMessage implements GridCa
      * @param futId Future id.
      * @param size Size.
      * @param topVer Topology version.
+     * @param addDepInfo Deployment info flag.
      */
-    GridCacheEvictionRequest(int cacheId, long futId, int size, @NotNull AffinityTopologyVersion topVer) {
+    GridCacheEvictionRequest(int cacheId, long futId, int size, @NotNull AffinityTopologyVersion topVer,
+        boolean addDepInfo) {
         assert futId > 0;
         assert size > 0;
         assert topVer.topologyVersion() > 0;
 
         this.cacheId = cacheId;
         this.futId = futId;
+        this.addDepInfo = addDepInfo;
 
         entries = new ArrayList<>(size);
 
@@ -82,15 +85,13 @@ public class GridCacheEvictionRequest extends GridCacheMessage implements GridCa
         super.prepareMarshal(ctx);
 
         if (entries != null) {
-            boolean depEnabled = ctx.deploymentEnabled();
-
             GridCacheContext cctx = ctx.cacheContext(cacheId);
 
             for (CacheEvictionEntry e : entries) {
                 e.prepareMarshal(cctx);
 
-                if (depEnabled)
-                    prepareObject(e.key().value(cctx.cacheObjectContext(), false), ctx);
+                if (addDepInfo)
+                    prepareObject(e.key().value(cctx.cacheObjectContext(), false), cctx);
             }
         }
     }
@@ -107,6 +108,11 @@ public class GridCacheEvictionRequest extends GridCacheMessage implements GridCa
         }
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
     /**
      * @return Future id.
      */
@@ -239,4 +245,4 @@ public class GridCacheEvictionRequest extends GridCacheMessage implements GridCa
     @Override public String toString() {
         return S.toString(GridCacheEvictionRequest.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java
index aa3911b..ebaee6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java
@@ -88,6 +88,11 @@ public class GridCacheEvictionResponse extends GridCacheMessage {
         finishUnmarshalCacheObjects(rejectedKeys, ctx.cacheContext(cacheId), ldr);
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return false;
+    }
+
     /**
      * @return Future ID.
      */
@@ -217,4 +222,4 @@ public class GridCacheEvictionResponse extends GridCacheMessage {
     @Override public String toString() {
         return S.toString(GridCacheEvictionResponse.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 476a96c..ec34f41 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -284,6 +284,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
 
     /**
      * Sends response on failed message.
+     *
      * @param nodeId node id.
      * @param res response.
      * @param cctx shared context.
@@ -302,6 +303,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
 
     /**
      * Processes failed messages.
+     *
      * @param nodeId niode id.
      * @param msg message.
      * @throws IgniteCheckedException If failed.
@@ -332,7 +334,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                     req.version(),
                     req.futureId(),
                     req.miniId(),
-                    0);
+                    0,
+                    ctx.deploymentEnabled());
 
                 sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
             }
@@ -345,7 +348,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                 GridDhtTxPrepareResponse res = new GridDhtTxPrepareResponse(
                     req.version(),
                     req.futureId(),
-                    req.miniId());
+                    req.miniId(),
+                    req.deployInfo() != null);
 
                 res.error(req.classError());
 
@@ -359,7 +363,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
 
                 GridDhtAtomicUpdateResponse res = new GridDhtAtomicUpdateResponse(
                     ctx.cacheId(),
-                    req.futureVersion());
+                    req.futureVersion(),
+                    ctx.deploymentEnabled());
 
                 res.onError(req.classError());
 
@@ -374,7 +379,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                 GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(
                     ctx.cacheId(),
                     nodeId,
-                    req.futureVersion());
+                    req.futureVersion(),
+                    ctx.deploymentEnabled());
 
                 res.error(req.classError());
 
@@ -389,7 +395,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                 GridDhtForceKeysResponse res = new GridDhtForceKeysResponse(
                     ctx.cacheId(),
                     req.futureId(),
-                    req.miniId()
+                    req.miniId(),
+                    ctx.deploymentEnabled()
                 );
 
                 res.error(req.classError());
@@ -414,7 +421,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                     ctx.cacheId(),
                     req.futureId(),
                     req.miniId(),
-                    req.version());
+                    req.version(),
+                    req.deployInfo() != null);
 
                 res.error(req.classError());
 
@@ -456,7 +464,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                     false,
                     0,
                     req.classError(),
-                    null);
+                    null,
+                    ctx.deploymentEnabled());
 
                 sendResponseOnFailedMessage(nodeId, res, cctx, ctx.ioPolicy());
             }
@@ -474,7 +483,8 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                     req.version(),
                     null,
                     null,
-                    null);
+                    null,
+                    req.deployInfo() != null);
 
                 res.error(req.classError());
 
@@ -540,7 +550,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
         if (destNodeId == null || !cctx.localNodeId().equals(destNodeId)) {
             msg.prepareMarshal(cctx);
 
-            if (depEnabled && msg instanceof GridCacheDeployable)
+            if (msg instanceof GridCacheDeployable && msg.addDeploymentInfo())
                 cctx.deploy().prepare((GridCacheDeployable)msg);
         }
 
@@ -766,8 +776,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
     }
 
     /**
-     * @return ID that auto-grows based on local counter and counters received
-     *      from other nodes.
+     * @return ID that auto-grows based on local counter and counters received from other nodes.
      */
     public long nextIoId() {
         return idGen.incrementAndGet();
@@ -784,8 +793,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
     public void sendNoRetry(ClusterNode node,
         GridCacheMessage msg,
         byte plc)
-        throws IgniteCheckedException
-    {
+        throws IgniteCheckedException {
         assert node != null;
         assert msg != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
index 4b700e0..bdd2118 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
+import javax.cache.processor.EntryProcessor;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.GridDirectTransient;
 import org.apache.ignite.internal.managers.deployment.GridDeployment;
@@ -30,6 +31,7 @@ import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoBean;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -67,6 +69,14 @@ public abstract class GridCacheMessage implements Message {
 
     /** */
     @GridDirectTransient
+    protected boolean addDepInfo;
+
+    /** Force addition of deployment info regardless of {@code addDepInfo} flag value.*/
+    @GridDirectTransient
+    protected boolean forceAddDepInfo;
+
+    /** */
+    @GridDirectTransient
     private IgniteCheckedException err;
 
     /** */
@@ -174,11 +184,20 @@ public abstract class GridCacheMessage implements Message {
     }
 
     /**
+     *  Deployment enabled flag indicates whether deployment info has to be added to this message.
+     *
+     * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
+     */
+    public abstract boolean addDeploymentInfo();
+
+    /**
      * @param o Object to prepare for marshalling.
      * @param ctx Context.
      * @throws IgniteCheckedException If failed.
      */
-    protected final void prepareObject(@Nullable Object o, GridCacheSharedContext ctx) throws IgniteCheckedException {
+    protected final void prepareObject(@Nullable Object o, GridCacheContext ctx) throws IgniteCheckedException {
+        assert addDepInfo || forceAddDepInfo;
+
         if (!skipPrepare && o != null) {
             GridDeploymentInfo d = ctx.deploy().globalDeploymentInfo();
 
@@ -259,16 +278,16 @@ public abstract class GridCacheMessage implements Message {
         if (info != null) {
             info.marshal(ctx);
 
-            if (ctx.deploymentEnabled()) {
+            if (addDepInfo) {
                 if (info.key() != null)
-                    prepareObject(info.key().value(ctx.cacheObjectContext(), false), ctx.shared());
+                    prepareObject(info.key().value(ctx.cacheObjectContext(), false), ctx);
 
                 CacheObject val = info.value();
 
                 if (val != null) {
                     val.finishUnmarshal(ctx.cacheObjectContext(), ctx.deploy().globalLoader());
 
-                    prepareObject(CU.value(val, ctx, false), ctx.shared());
+                    prepareObject(CU.value(val, ctx, false), ctx);
                 }
             }
         }
@@ -332,18 +351,31 @@ public abstract class GridCacheMessage implements Message {
 
         if (txEntries != null) {
             boolean transferExpiry = transferExpiryPolicy();
+            boolean p2pEnabled = ctx.deploymentEnabled();
 
             for (IgniteTxEntry e : txEntries) {
                 e.marshal(ctx, transferExpiry);
 
-                if (ctx.deploymentEnabled()) {
-                    CacheObjectContext cctx =ctx.cacheContext(e.cacheId()).cacheObjectContext();
+                GridCacheContext cctx = e.context();
 
+                if (addDepInfo) {
                     if (e.key() != null)
-                        prepareObject(e.key().value(cctx, false), ctx);
+                        prepareObject(e.key().value(cctx.cacheObjectContext(), false), cctx);
 
                     if (e.value() != null)
-                        prepareObject(e.value().value(cctx, false), ctx);
+                        prepareObject(e.value().value(cctx.cacheObjectContext(), false), cctx);
+
+                    if (e.entryProcessors() != null) {
+                        for (T2<EntryProcessor<Object, Object, Object>, Object[]> entProc : e.entryProcessors())
+                            prepareObject(entProc.get1(), cctx);
+                    }
+                }
+                else if (p2pEnabled && e.entryProcessors() != null) {
+                    if (!forceAddDepInfo)
+                        forceAddDepInfo = true;
+
+                    for (T2<EntryProcessor<Object, Object, Object>, Object[]> entProc : e.entryProcessors())
+                        prepareObject(entProc.get1(), cctx);
                 }
             }
         }
@@ -381,8 +413,8 @@ public abstract class GridCacheMessage implements Message {
      * @return Marshalled collection.
      * @throws IgniteCheckedException If failed.
      */
-    @Nullable protected final byte[][] marshalInvokeArguments(@Nullable Object[] args,
-        GridCacheSharedContext ctx) throws IgniteCheckedException {
+    @Nullable protected final byte[][] marshalInvokeArguments(@Nullable Object[] args, GridCacheContext ctx)
+        throws IgniteCheckedException {
         assert ctx != null;
 
         if (args == null || args.length == 0)
@@ -393,7 +425,7 @@ public abstract class GridCacheMessage implements Message {
         for (int i = 0; i < args.length; i++) {
             Object arg = args[i];
 
-            if (ctx.deploymentEnabled())
+            if (addDepInfo)
                 prepareObject(arg, ctx);
 
             argsBytes[i] = arg == null ? null : CU.marshal(ctx, arg);
@@ -436,7 +468,7 @@ public abstract class GridCacheMessage implements Message {
      * @throws IgniteCheckedException If failed.
      */
     @Nullable protected List<byte[]> marshalCollection(@Nullable Collection<?> col,
-        GridCacheSharedContext ctx) throws IgniteCheckedException {
+        GridCacheContext ctx) throws IgniteCheckedException {
         assert ctx != null;
 
         if (col == null)
@@ -445,7 +477,7 @@ public abstract class GridCacheMessage implements Message {
         List<byte[]> byteCol = new ArrayList<>(col.size());
 
         for (Object o : col) {
-            if (ctx.deploymentEnabled())
+            if (addDepInfo)
                 prepareObject(o, ctx);
 
             byteCol.add(o == null ? null : CU.marshal(ctx, o));
@@ -467,16 +499,14 @@ public abstract class GridCacheMessage implements Message {
 
         int size = col.size();
 
-        boolean depEnabled = ctx.deploymentEnabled();
-
         for (int i = 0 ; i < size; i++) {
             CacheObject obj = col.get(i);
 
             if (obj != null) {
                 obj.prepareMarshal(ctx.cacheObjectContext());
 
-                if (depEnabled)
-                    prepareObject(obj.value(ctx.cacheObjectContext(), false), ctx.shared());
+                if (addDepInfo)
+                    prepareObject(obj.value(ctx.cacheObjectContext(), false), ctx);
             }
         }
     }
@@ -491,14 +521,12 @@ public abstract class GridCacheMessage implements Message {
         if (col == null)
             return;
 
-        boolean depEnabled = ctx.deploymentEnabled();
-
         for (CacheObject obj : col) {
             if (obj != null) {
                 obj.prepareMarshal(ctx.cacheObjectContext());
 
-                if (depEnabled)
-                    prepareObject(obj.value(ctx.cacheObjectContext(), false), ctx.shared());
+                if (addDepInfo)
+                    prepareObject(obj.value(ctx.cacheObjectContext(), false), ctx);
             }
         }
     }
@@ -649,4 +677,4 @@ public abstract class GridCacheMessage implements Message {
     @Override public String toString() {
         return S.toString(GridCacheMessage.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index c5d4162..b37742c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@ -558,6 +558,9 @@ public class GridCacheSharedContext<K, V> {
             if (store.isWriteBehind() != activeStore.isWriteBehind())
                 return "caches with different write-behind setting can't be enlisted in one transaction";
 
+            if (activeCacheCtx.deploymentEnabled() != cacheCtx.deploymentEnabled())
+                return "caches with enabled and disabled deployment modes can't be enlisted in one transaction";
+
             // If local and write-behind validations passed, this must be true.
             assert store.isWriteToStoreFromDht() == activeStore.isWriteToStoreFromDht();
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 7854c93..ee1f4a1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -925,11 +925,25 @@ public class GridCacheUtils {
      * @throws IgniteCheckedException If marshalling failed.
      */
     @SuppressWarnings("unchecked")
-    public static byte[] marshal(GridCacheSharedContext ctx, Object obj)
+    public static byte[] marshal(GridCacheContext ctx, Object obj)
         throws IgniteCheckedException {
         assert ctx != null;
 
-        if (ctx.gridDeploy().enabled()) {
+        return marshal(ctx.shared(), ctx.deploymentEnabled(), obj);
+    }
+
+    /**
+     * @param ctx Cache context.
+     * @param depEnabled deployment enabled flag.
+     * @param obj Object to marshal.
+     * @return Buffer that contains obtained byte array.
+     * @throws IgniteCheckedException If marshalling failed.
+     */
+    public static byte[] marshal(GridCacheSharedContext ctx, boolean depEnabled, Object obj)
+        throws IgniteCheckedException {
+        assert ctx != null;
+
+        if (depEnabled) {
             if (obj != null) {
                 if (obj instanceof Iterable)
                     ctx.deploy().registerClasses((Iterable<?>)obj);
@@ -1797,4 +1811,4 @@ public class GridCacheUtils {
             }
         };
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java
index c911b5b..8177c98 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java
@@ -194,6 +194,11 @@ public class GridCacheTtlUpdateRequest extends GridCacheMessage {
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -327,4 +332,4 @@ public class GridCacheTtlUpdateRequest extends GridCacheMessage {
     @Override public String toString() {
         return S.toString(GridCacheTtlUpdateRequest.class, this, "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
index d6f6a18..4d75403 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
@@ -162,7 +162,8 @@ public class GridCacheTxRecoveryFuture extends GridCompoundIdentityFuture<Boolea
                     0,
                     true,
                     futureId(),
-                    fut.futureId());
+                    fut.futureId(),
+                    tx.activeCachesDeploymentEnabled());
 
                 try {
                     cctx.io().send(nearNodeId, req, tx.ioPolicy());
@@ -267,7 +268,8 @@ public class GridCacheTxRecoveryFuture extends GridCompoundIdentityFuture<Boolea
                         nodeTransactions(id),
                         false,
                         futureId(),
-                        fut.futureId());
+                        fut.futureId(),
+                        tx.activeCachesDeploymentEnabled());
 
                     try {
                         cctx.io().send(id, req, tx.ioPolicy());
@@ -292,7 +294,8 @@ public class GridCacheTxRecoveryFuture extends GridCompoundIdentityFuture<Boolea
                     nodeTransactions(nodeId),
                     false,
                     futureId(),
-                    fut.futureId());
+                    fut.futureId(),
+                    tx.activeCachesDeploymentEnabled());
 
                 try {
                     cctx.io().send(nodeId, req, tx.ioPolicy());

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
index bd6cd88..e5787d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
@@ -64,14 +64,16 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
      * @param nearTxCheck {@code True} if should check only tx on near node.
      * @param futId Future ID.
      * @param miniId Mini future ID.
+     * @param addDepInfo Deployment info flag.
      */
     public GridCacheTxRecoveryRequest(IgniteInternalTx tx,
         int txNum,
         boolean nearTxCheck,
         IgniteUuid futId,
-        IgniteUuid miniId)
+        IgniteUuid miniId,
+        boolean addDepInfo)
     {
-        super(tx.xidVersion(), 0);
+        super(tx.xidVersion(), 0, addDepInfo);
 
         nearXidVer = tx.nearXidVersion();
         sys = tx.system();
@@ -258,4 +260,4 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
     @Override public String toString() {
         return S.toString(GridCacheTxRecoveryRequest.class, this, "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
index 8b9550f..361d381 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
@@ -53,17 +53,21 @@ public class GridCacheTxRecoveryResponse extends GridDistributedBaseMessage {
      * @param futId Future ID.
      * @param miniId Mini future ID.
      * @param success {@code True} if all remote transactions were prepared, {@code false} otherwise.
+     * @param addDepInfo Deployment info flag.
      */
     public GridCacheTxRecoveryResponse(GridCacheVersion txId,
         IgniteUuid futId,
         IgniteUuid miniId,
-        boolean success)
+        boolean success,
+        boolean addDepInfo)
     {
-        super(txId, 0);
+        super(txId, 0, addDepInfo);
 
         this.futId = futId;
         this.miniId = miniId;
         this.success = success;
+
+        this.addDepInfo = addDepInfo;
     }
 
     /**
@@ -179,4 +183,4 @@ public class GridCacheTxRecoveryResponse extends GridDistributedBaseMessage {
     @Override public String toString() {
         return S.toString(GridCacheTxRecoveryResponse.class, this, "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java
index 689cc62..f4a16dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java
@@ -86,19 +86,22 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
 
     /**
      * @param cnt Count of keys references in list of candidates.
+     * @param addDepInfo Deployment info flag.
      */
-    protected GridDistributedBaseMessage(int cnt) {
+    protected GridDistributedBaseMessage(int cnt, boolean addDepInfo) {
         assert cnt >= 0;
 
         this.cnt = cnt;
+        this.addDepInfo = addDepInfo;
     }
 
     /**
      * @param ver Either lock or transaction version.
      * @param cnt Key count.
+     * @param addDepInfo Deployment info flag.
      */
-    protected GridDistributedBaseMessage(GridCacheVersion ver, int cnt) {
-        this(cnt);
+    protected GridDistributedBaseMessage(GridCacheVersion ver, int cnt, boolean addDepInfo) {
+        this(cnt, addDepInfo);
 
         assert ver != null;
 
@@ -122,6 +125,11 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
             candsByIdx = ctx.marshaller().unmarshal(candsByIdxBytes, ldr);
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
     /**
      * @return Version.
      */
@@ -290,4 +298,4 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
     @Override public String toString() {
         return S.toString(GridDistributedBaseMessage.class, this, "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
index 1963894..2899e25 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -118,6 +118,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
      * @param keyCnt Number of keys.
      * @param txSize Expected transaction size.
      * @param skipStore Skip store flag.
+     * @param addDepInfo Deployment info flag.
      */
     public GridDistributedLockRequest(
         int cacheId,
@@ -133,9 +134,10 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
         long timeout,
         int keyCnt,
         int txSize,
-        boolean skipStore
+        boolean skipStore,
+        boolean addDepInfo
     ) {
-        super(lockVer, keyCnt);
+        super(lockVer, keyCnt, addDepInfo);
 
         assert keyCnt > 0;
         assert futId != null;
@@ -551,4 +553,4 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
         return S.toString(GridDistributedLockRequest.class, this, "keysCnt", retVals.length,
             "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
index 8a95b14..cdd58b5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
@@ -72,12 +72,14 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
      * @param lockVer Lock version.
      * @param futId Future ID.
      * @param cnt Key count.
+     * @param addDepInfo Deployment info.
      */
     public GridDistributedLockResponse(int cacheId,
         GridCacheVersion lockVer,
         IgniteUuid futId,
-        int cnt) {
-        super(lockVer, cnt);
+        int cnt,
+        boolean addDepInfo) {
+        super(lockVer, cnt, addDepInfo);
 
         assert futId != null;
 
@@ -92,12 +94,14 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
      * @param lockVer Lock ID.
      * @param futId Future ID.
      * @param err Error.
+     * @param addDepInfo Deployment info.
      */
     public GridDistributedLockResponse(int cacheId,
         GridCacheVersion lockVer,
         IgniteUuid futId,
-        Throwable err) {
-        super(lockVer, 0);
+        Throwable err,
+        boolean addDepInfo) {
+        super(lockVer, 0, addDepInfo);
 
         assert futId != null;
 
@@ -112,13 +116,15 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
      * @param futId Future ID.
      * @param cnt Count.
      * @param err Error.
+     * @param addDepInfo Deployment info.
      */
     public GridDistributedLockResponse(int cacheId,
         GridCacheVersion lockVer,
         IgniteUuid futId,
         int cnt,
-        Throwable err) {
-        super(lockVer, cnt);
+        Throwable err,
+        boolean addDepInfo) {
+        super(lockVer, cnt, addDepInfo);
 
         assert futId != null;
 
@@ -325,4 +331,4 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
         return S.toString(GridDistributedLockResponse.class, this,
             "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
index ddf6799..34b3112 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
@@ -89,6 +89,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
      * @param committedVers Committed versions.
      * @param rolledbackVers Rolled back versions.
      * @param txSize Expected transaction size.
+     * @param addDepInfo Deployment info flag.
      */
     public GridDistributedTxFinishRequest(
         GridCacheVersion xidVer,
@@ -104,9 +105,10 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
         GridCacheVersion baseVer,
         Collection<GridCacheVersion> committedVers,
         Collection<GridCacheVersion> rolledbackVers,
-        int txSize
+        int txSize,
+        boolean addDepInfo
     ) {
-        super(xidVer, 0);
+        super(xidVer, 0, addDepInfo);
         assert xidVer != null;
 
         this.futId = futId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishResponse.java
index 2cfafc1..4e17e79 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishResponse.java
@@ -74,6 +74,11 @@ public class GridDistributedTxFinishResponse extends GridCacheMessage {
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -151,4 +156,4 @@ public class GridDistributedTxFinishResponse extends GridCacheMessage {
     @Override public String toString() {
         return GridToStringBuilder.toString(GridDistributedTxFinishResponse.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index 5ba7128..533c8ca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -131,15 +131,17 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
      * @param writes Write entries.
      * @param txNodes Transaction nodes mapping.
      * @param onePhaseCommit One phase commit flag.
+     * @param addDepInfo Deployment info flag.
      */
     public GridDistributedTxPrepareRequest(
         IgniteInternalTx tx,
         @Nullable Collection<IgniteTxEntry> reads,
         Collection<IgniteTxEntry> writes,
         Map<UUID, Collection<UUID>> txNodes,
-        boolean onePhaseCommit
+        boolean onePhaseCommit,
+        boolean addDepInfo
     ) {
-        super(tx.xidVersion(), 0);
+        super(tx.xidVersion(), 0, addDepInfo);
 
         writeVer = tx.writeVersion();
         threadId = tx.threadId();
@@ -337,6 +339,11 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo || forceAddDepInfo;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -605,4 +612,4 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
         return GridToStringBuilder.toString(GridDistributedTxPrepareRequest.class, this,
             "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
index e798458..d2c5aa4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
@@ -52,17 +52,19 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
 
     /**
      * @param xid Transaction ID.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridDistributedTxPrepareResponse(GridCacheVersion xid) {
-        super(xid, 0);
+    public GridDistributedTxPrepareResponse(GridCacheVersion xid, boolean addDepInfo) {
+        super(xid, 0, addDepInfo);
     }
 
     /**
      * @param xid Lock ID.
      * @param err Error.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridDistributedTxPrepareResponse(GridCacheVersion xid, Throwable err) {
-        super(xid, 0);
+    public GridDistributedTxPrepareResponse(GridCacheVersion xid, Throwable err, boolean addDepInfo) {
+        super(xid, 0, addDepInfo);
 
         this.err = err;
     }
@@ -168,4 +170,4 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
         return GridToStringBuilder.toString(GridDistributedTxPrepareResponse.class, this, "err",
             err == null ? "null" : err.toString(), "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index f969737..0834e88 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -192,6 +192,11 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
         return Collections.emptyList();
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean activeCachesDeploymentEnabled() {
+        return false;
+    }
+
     /**
      * @return Checks if transaction has no entries.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
index 70c83f2..213a0ff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
@@ -54,9 +54,10 @@ public class GridDistributedUnlockRequest extends GridDistributedBaseMessage {
     /**
      * @param cacheId Cache ID.
      * @param keyCnt Key count.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridDistributedUnlockRequest(int cacheId, int keyCnt) {
-        super(keyCnt);
+    public GridDistributedUnlockRequest(int cacheId, int keyCnt, boolean addDepInfo) {
+        super(keyCnt, addDepInfo);
 
         this.cacheId = cacheId;
     }
@@ -159,4 +160,4 @@ public class GridDistributedUnlockRequest extends GridDistributedBaseMessage {
     @Override public String toString() {
         return S.toString(GridDistributedUnlockRequest.class, this, "super", super.toString());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
index e6a5c9a..0ef7606 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
@@ -52,6 +52,11 @@ public class GridDhtAffinityAssignmentRequest extends GridCacheMessage {
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean partitionExchangeMessage() {
         return true;
     }
@@ -127,4 +132,4 @@ public class GridDhtAffinityAssignmentRequest extends GridCacheMessage {
     @Override public String toString() {
         return S.toString(GridDhtAffinityAssignmentRequest.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
index 2798d7c..42358d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
@@ -135,6 +135,11 @@ public class GridDhtAffinityAssignmentResponse extends GridCacheMessage {
     }
 
     /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
 
@@ -202,4 +207,4 @@ public class GridDhtAffinityAssignmentResponse extends GridCacheMessage {
     @Override public String toString() {
         return S.toString(GridDhtAffinityAssignmentResponse.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 333bce2..9d02705 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -694,7 +694,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
                 GridNearGetResponse res = new GridNearGetResponse(ctx.cacheId(),
                     req.futureId(),
                     req.miniId(),
-                    req.version());
+                    req.version(),
+                    req.deployInfo() != null);
 
                 GridDhtFuture<Collection<GridCacheEntryInfo>> fut =
                     (GridDhtFuture<Collection<GridCacheEntryInfo>>)f;

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 2c16534..4f3e97d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -866,7 +866,8 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
                         inTx() ? tx.subjectId() : null,
                         inTx() ? tx.taskNameHash() : 0,
                         read ? accessTtl : -1L,
-                        skipStore);
+                        skipStore,
+                        cctx.deploymentEnabled());
 
                     try {
                         for (ListIterator<GridDhtCacheEntry> it = dhtMapping.listIterator(); it.hasNext();) {
@@ -1236,4 +1237,4 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
             return S.toString(MiniFuture.class, this, "nodeId", node.id(), "super", super.toString());
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
index 99c1b86..91ab1ca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -120,6 +120,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
      * @param taskNameHash Task name hash code.
      * @param accessTtl TTL for read operation.
      * @param skipStore Skip store flag.
+     * @param addDepInfo Deployment info flag.
      */
     public GridDhtLockRequest(
         int cacheId,
@@ -141,7 +142,8 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
         @Nullable UUID subjId,
         int taskNameHash,
         long accessTtl,
-        boolean skipStore
+        boolean skipStore,
+        boolean addDepInfo
     ) {
         super(cacheId,
             nodeId,
@@ -156,7 +158,8 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
             timeout,
             dhtCnt == 0 ? nearCnt : dhtCnt,
             txSize,
-            skipStore);
+            skipStore,
+            addDepInfo);
 
         this.topVer = topVer;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
index f79156b..1e92b54 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
@@ -75,9 +75,11 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
      * @param futId Future ID.
      * @param miniId Mini future ID.
      * @param cnt Key count.
+     * @param addDepInfo Deployment info.
      */
-    public GridDhtLockResponse(int cacheId, GridCacheVersion lockVer, IgniteUuid futId, IgniteUuid miniId, int cnt) {
-        super(cacheId, lockVer, futId, cnt);
+    public GridDhtLockResponse(int cacheId, GridCacheVersion lockVer, IgniteUuid futId, IgniteUuid miniId, int cnt,
+        boolean addDepInfo) {
+        super(cacheId, lockVer, futId, cnt, addDepInfo);
 
         assert miniId != null;
 
@@ -89,9 +91,11 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
      * @param futId Future ID.
      * @param miniId Mini future ID.
      * @param err Error.
+     * @param addDepInfo
      */
-    public GridDhtLockResponse(int cacheId, GridCacheVersion lockVer, IgniteUuid futId, IgniteUuid miniId, Throwable err) {
-        super(cacheId, lockVer, futId, err);
+    public GridDhtLockResponse(int cacheId, GridCacheVersion lockVer, IgniteUuid futId, IgniteUuid miniId,
+        Throwable err, boolean addDepInfo) {
+        super(cacheId, lockVer, futId, err, addDepInfo);
 
         assert miniId != null;
 
@@ -291,4 +295,4 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
     @Override public String toString() {
         return S.toString(GridDhtLockResponse.class, this, super.toString());
     }
-}
\ No newline at end of file
+}


[16/16] ignite git commit: ignite-801: fixed IgniteQueue failover tests

Posted by dm...@apache.org.
ignite-801: fixed IgniteQueue failover tests


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

Branch: refs/heads/ignite-801
Commit: 97c859d0af699b0f7c878126911f6d061ce825c0
Parents: 5ea234c
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Oct 27 16:32:13 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Oct 27 16:32:13 2015 +0300

----------------------------------------------------------------------
 .../discovery/GridDiscoveryManager.java         | 12 ++++++++
 .../CacheDataStructuresManager.java             |  1 +
 .../dht/GridPartitionedGetFuture.java           |  3 +-
 .../distributed/near/GridNearGetFuture.java     |  2 +-
 .../datastructures/DataStructuresProcessor.java |  1 +
 .../datastructures/GridCacheQueueAdapter.java   | 32 ++++++++++++--------
 .../ignite/spi/discovery/DiscoverySpi.java      |  9 +++++-
 ...eAbstractDataStructuresFailoverSelfTest.java | 10 +++++-
 8 files changed, 53 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/97c859d0/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 6aba211..fb2efe2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -102,6 +102,7 @@ import org.apache.ignite.lang.IgniteProductVersion;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.plugin.security.SecurityCredentials;
 import org.apache.ignite.plugin.segmentation.SegmentationPolicy;
+import org.apache.ignite.spi.IgniteSpi;
 import org.apache.ignite.spi.IgniteSpiException;
 import org.apache.ignite.spi.discovery.DiscoveryMetricsProvider;
 import org.apache.ignite.spi.discovery.DiscoverySpi;
@@ -1767,6 +1768,17 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
     }
 
     /**
+     * Failure detection timeout used by discovery SPI. If the timeout is disabled then a value of the
+     * network timeout is returned.
+     *
+     * @return .
+     */
+    public long failureDetectionTimeout() {
+        return getSpi().failureDetectionTimeoutEnabled() ? ctx.config().getFailureDetectionTimeout() :
+            ctx.config().getNetworkTimeout();
+    }
+
+    /**
      * Updates topology version if current version is smaller than updated.
      *
      * @param updated Updated topology version.

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c859d0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
index 930921b..ac90efc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
@@ -60,6 +60,7 @@ import org.apache.ignite.internal.processors.datastructures.GridTransactionalCac
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridSpinBusyLock;
+import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c859d0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index a68e834..e0e8f6d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -710,8 +710,9 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
                 final AffinityTopologyVersion updTopVer =
                     new AffinityTopologyVersion(Math.max(topVer.topologyVersion() + 1, cctx.discovery().topologyVersion()));
 
+
                 final GridFutureRemapTimeoutObject timeout = new GridFutureRemapTimeoutObject(this,
-                    cctx.kernalContext().config().getNetworkTimeout(),
+                    cctx.discovery().failureDetectionTimeout(),
                     updTopVer,
                     e);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c859d0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index eca2f71..1fb4c95 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
@@ -845,7 +845,7 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma
                     new AffinityTopologyVersion(Math.max(topVer.topologyVersion() + 1, cctx.discovery().topologyVersion()));
 
                 final GridFutureRemapTimeoutObject timeout = new GridFutureRemapTimeoutObject(this,
-                    cctx.kernalContext().config().getNetworkTimeout(),
+                    cctx.discovery().failureDetectionTimeout(),
                     updTopVer,
                     e);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c859d0/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
index 0f2c7a1..11f6134 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
@@ -63,6 +63,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheInternal;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
 import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException;
+import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.lang.IgniteClosureX;
 import org.apache.ignite.internal.util.lang.IgniteInClosureX;
 import org.apache.ignite.internal.util.lang.IgniteOutClosureX;

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c859d0/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
index 0e4aebc..0843eac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
@@ -169,14 +169,22 @@ public abstract class GridCacheQueueAdapter<T> extends AbstractCollection<T> imp
     @SuppressWarnings("unchecked")
     @Nullable @Override public T peek() throws IgniteException {
         try {
-            GridCacheQueueHeader hdr = (GridCacheQueueHeader)cache.get(queueKey);
+            while (true) {
+                GridCacheQueueHeader hdr = (GridCacheQueueHeader)cache.get(queueKey);
 
-            checkRemoved(hdr);
+                checkRemoved(hdr);
 
-            if (hdr.empty())
-                return null;
+                if (hdr.empty())
+                    return null;
+
+                T val = (T)cache.get(itemKey(hdr.head()));
 
-            return (T)cache.get(itemKey(hdr.head()));
+                if (val == null)
+                    // Header might have been polled. Retry.
+                    continue;
+
+                return val;
+            }
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -416,8 +424,7 @@ public abstract class GridCacheQueueAdapter<T> extends AbstractCollection<T> imp
         long startIdx,
         long endIdx,
         int batchSize)
-        throws IgniteCheckedException
-    {
+        throws IgniteCheckedException {
         Set<GridCacheQueueItemKey> keys = new HashSet<>(batchSize > 0 ? batchSize : 10);
 
         for (long idx = startIdx; idx < endIdx; idx++) {
@@ -435,8 +442,7 @@ public abstract class GridCacheQueueAdapter<T> extends AbstractCollection<T> imp
     }
 
     /**
-     * Checks result of closure modifying queue header, throws {@link IllegalStateException}
-     * if queue was removed.
+     * Checks result of closure modifying queue header, throws {@link IllegalStateException} if queue was removed.
      *
      * @param idx Result of closure execution.
      */
@@ -529,7 +535,6 @@ public abstract class GridCacheQueueAdapter<T> extends AbstractCollection<T> imp
      */
     protected abstract void removeItem(long rmvIdx) throws IgniteCheckedException;
 
-
     /**
      * @param idx Item index.
      * @return Item key.
@@ -816,7 +821,8 @@ public abstract class GridCacheQueueAdapter<T> extends AbstractCollection<T> imp
                 }
 
                 next++;
-            } while (next != hdr.tail());
+            }
+            while (next != hdr.tail());
 
             GridCacheQueueHeader newHdr = new GridCacheQueueHeader(hdr.id(),
                 hdr.capacity(),
@@ -1036,7 +1042,7 @@ public abstract class GridCacheQueueAdapter<T> extends AbstractCollection<T> imp
         if (o == null || getClass() != o.getClass())
             return false;
 
-        GridCacheQueueAdapter that = (GridCacheQueueAdapter) o;
+        GridCacheQueueAdapter that = (GridCacheQueueAdapter)o;
 
         return id.equals(that.id);
 
@@ -1051,4 +1057,4 @@ public abstract class GridCacheQueueAdapter<T> extends AbstractCollection<T> imp
     @Override public String toString() {
         return S.toString(GridCacheQueueAdapter.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c859d0/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java
index 612c1f1..baa26d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java
@@ -164,4 +164,11 @@ public interface DiscoverySpi extends IgniteSpi {
      * @throws IllegalStateException If discovery SPI has not started.
      */
     public boolean isClientMode() throws IllegalStateException;
-}
\ No newline at end of file
+
+    /**
+     * Checks whether failure detection timeout is enabled for the discovery SPI.
+     *
+     * @return {@code true} if enabled, {@code false} otherwise.
+     */
+    public boolean failureDetectionTimeoutEnabled();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c859d0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractDataStructuresFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractDataStructuresFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractDataStructuresFailoverSelfTest.java
index 185460c..6e91107 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractDataStructuresFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractDataStructuresFailoverSelfTest.java
@@ -449,7 +449,15 @@ public abstract class GridCacheAbstractDataStructuresFailoverSelfTest extends Ig
 
             IgniteInternalFuture<?> fut = topWorker.startChangingTopology(new IgniteClosure<Ignite, Object>() {
                 @Override public Object apply(Ignite ignite) {
-                    assert ignite.<Integer>queue(STRUCTURE_NAME, 0, null).peek() > 0;
+                    IgniteQueue<Integer> queue = ignite.queue(STRUCTURE_NAME, 0, null);
+
+                    assertNotNull(queue);
+
+                    Integer val = queue.peek();
+
+                    assertNotNull(val);
+
+                    assert val > 0;
 
                     return null;
                 }


[04/16] ignite git commit: IGNITE-1653

Posted by dm...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
deleted file mode 100644
index 035ab98..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  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 hibernate-mapping PUBLIC
-        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping default-access="field">
-    <class name="org.apache.ignite.examples.datagrid.store.Person" table="PERSONS">
-        <!-- ID. -->
-        <id name="id"/>
-
-        <!-- We only map data we are interested in. -->
-        <property name="firstName"/>
-        <property name="lastName"/>
-    </class>
-</hibernate-mapping>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
deleted file mode 100644
index 80a43e7..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-
-<!--
-  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 hibernate-configuration PUBLIC
-        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
-
-<!--
-    Hibernate configuration.
--->
-<hibernate-configuration>
-    <session-factory>
-        <!-- Database connection settings (private in-memory database). -->
-        <property name="connection.url">jdbc:h2:mem:example;DB_CLOSE_DELAY=-1</property>
-
-        <!-- Only validate the database schema on startup in production mode. -->
-        <property name="hbm2ddl.auto">update</property>
-
-        <!-- Do not output SQL. -->
-        <property name="show_sql">false</property>
-
-        <!-- Mappings. -->
-        <mapping resource="org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml"/>
-    </session-factory>
-</hibernate-configuration>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/package-info.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/package-info.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/package-info.java
deleted file mode 100644
index 7210b49..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/package-info.java
+++ /dev/null
@@ -1,22 +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 description. -->
- * Contains Hibernate-based cache store implementation.
- */
-package org.apache.ignite.examples.datagrid.store.hibernate;

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/misc/schedule/ComputeScheduleExample.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/misc/schedule/ComputeScheduleExample.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/misc/schedule/ComputeScheduleExample.java
deleted file mode 100644
index f8d0660..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/misc/schedule/ComputeScheduleExample.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.misc.schedule;
-
-import java.util.concurrent.Callable;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.examples.ExampleNodeStartup;
-import org.apache.ignite.lang.IgniteRunnable;
-import org.apache.ignite.scheduler.SchedulerFuture;
-
-/**
- * Demonstrates a cron-based {@link Runnable} execution scheduling.
- * Test runnable object broadcasts a phrase to all cluster nodes every minute
- * three times with initial scheduling delay equal to five seconds.
- * <p>
- * Remote nodes should always be started with special configuration file which
- * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
- * <p>
- * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will start node
- * with {@code examples/config/example-ignite.xml} configuration.
- */
-public class ComputeScheduleExample {
-    /**
-     * Executes example.
-     *
-     * @param args Command line arguments, none required.
-     * @throws IgniteException If example execution failed.
-     */
-    public static void main(String[] args) throws IgniteException {
-        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
-            System.out.println();
-            System.out.println("Compute schedule example started.");
-
-            // Schedule output message every minute.
-            SchedulerFuture<?> fut = ignite.scheduler().scheduleLocal(
-                new Callable<Integer>() {
-                    private int invocations;
-
-                    @Override public Integer call() {
-                        invocations++;
-
-                        ignite.compute().broadcast(
-                            new IgniteRunnable() {
-                                @Override public void run() {
-                                    System.out.println();
-                                    System.out.println("Howdy! :)");
-                                }
-                            }
-                        );
-
-                        return invocations;
-                    }
-                },
-                "{5, 3} * * * * *" // Cron expression.
-            );
-
-            while (!fut.isDone())
-                System.out.println(">>> Invocation #: " + fut.get());
-
-            System.out.println();
-            System.out.println(">>> Schedule future is done and has been unscheduled.");
-            System.out.println(">>> Check all nodes for hello message output.");
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/misc/schedule/package-info.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/misc/schedule/package-info.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/misc/schedule/package-info.java
deleted file mode 100644
index 6602a6e..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/misc/schedule/package-info.java
+++ /dev/null
@@ -1,22 +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 description. -->
- * Demonstrates usage of cron-based scheduler.
- */
-package org.apache.ignite.examples.misc.schedule;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/misc/schedule/ComputeScheduleExample.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/misc/schedule/ComputeScheduleExample.java b/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/misc/schedule/ComputeScheduleExample.java
deleted file mode 100644
index c250638..0000000
--- a/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/misc/schedule/ComputeScheduleExample.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.java8.misc.schedule;
-
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.examples.ExampleNodeStartup;
-import org.apache.ignite.scheduler.SchedulerFuture;
-
-/**
- * Demonstrates a cron-based {@link Runnable} execution scheduling.
- * Test runnable object broadcasts a phrase to all cluster nodes every minute
- * three times with initial scheduling delay equal to five seconds.
- * <p>
- * Remote nodes should always be started with special configuration file which
- * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
- * <p>
- * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will start node
- * with {@code examples/config/example-ignite.xml} configuration.
- */
-public class ComputeScheduleExample {
-    /**
-     * Executes example.
-     *
-     * @param args Command line arguments, none required.
-     * @throws IgniteException If example execution failed.
-     */
-    public static void main(String[] args) throws IgniteException {
-        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
-            System.out.println();
-            System.out.println("Compute schedule example started.");
-
-            // Schedule output message every minute.
-            SchedulerFuture<?> fut = ignite.scheduler().scheduleLocal(() ->
-                ignite.compute().broadcast(() -> {
-                    System.out.println();
-                    System.out.println("Howdy! :)");
-
-                    return "Howdy! :)";
-                }),
-                "{5, 3} * * * * *" // Cron expression.
-            );
-
-            while (!fut.isDone())
-                System.out.println(">>> Invocation result: " + fut.get());
-
-            System.out.println();
-            System.out.println(">>> Schedule future is done and has been unscheduled.");
-            System.out.println(">>> Check all nodes for hello message output.");
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/misc/schedule/package-info.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/misc/schedule/package-info.java b/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/misc/schedule/package-info.java
deleted file mode 100644
index 5855994..0000000
--- a/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/misc/schedule/package-info.java
+++ /dev/null
@@ -1,22 +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 description. -->
- * Demonstrates usage of cron-based scheduler.
- */
-package org.apache.ignite.examples.java8.misc.schedule;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/package-info.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/package-info.java b/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/package-info.java
deleted file mode 100644
index 66847dc..0000000
--- a/examples-lgpl/src/main/java8/org/apache/ignite/examples/java8/package-info.java
+++ /dev/null
@@ -1,23 +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 description. -->
- * Basic examples for ignite functionality utilizing Java8 lambdas.
- * Use "java8" examples with JDK8 in addition to the "java" examples.
- */
-package org.apache.ignite.examples.java8;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala b/examples-lgpl/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala
deleted file mode 100644
index 8734a23..0000000
--- a/examples-lgpl/src/main/scala/org/apache/ignite/scalar/examples/ScalarScheduleExample.scala
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.scalar.examples
-
-import org.apache.ignite.scalar.scalar
-import org.apache.ignite.scalar.scalar._
-
-/**
- * Demonstrates a cron-based `Runnable` execution scheduling.
- * Test runnable object broadcasts a phrase to all cluster nodes every minute
- * three times with initial scheduling delay equal to five seconds.
- * <p/>
- * Remote nodes should always be started with special configuration file which
- * enables P2P class loading: `'ignite.{sh|bat} examples/config/example-ignite.xml'`.
- * <p/>
- * Alternatively you can run `ExampleNodeStartup` in another JVM which will
- * start node with `examples/config/example-ignite.xml` configuration.
- */
-object ScalarScheduleExample extends App {
-    scalar("examples/config/example-ignite.xml") {
-        println()
-        println("Compute schedule example started.")
-
-        val g = ignite$
-
-        var invocations = 0
-
-        // Schedule callable that returns incremented value each time.
-        val fut = ignite$.scheduleLocalCall(
-            () => {
-                invocations += 1
-
-                g.bcastRun(() => {
-                    println()
-                    println("Howdy! :)")
-                }, null)
-
-                invocations
-            },
-            "{5, 3} * * * * *" // Cron expression.
-        )
-
-        while (!fut.isDone)
-            println(">>> Invocation #: " + fut.get)
-
-        // Prints.
-        println()
-        println(">>> Schedule future is done and has been unscheduled.")
-        println(">>> Check all nodes for hello message output.")
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/java/org/apache/ignite/examples/HibernateL2CacheExampleMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/java/org/apache/ignite/examples/HibernateL2CacheExampleMultiNodeSelfTest.java b/examples-lgpl/src/test/java/org/apache/ignite/examples/HibernateL2CacheExampleMultiNodeSelfTest.java
deleted file mode 100644
index 8a40d4a..0000000
--- a/examples-lgpl/src/test/java/org/apache/ignite/examples/HibernateL2CacheExampleMultiNodeSelfTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples;
-
-import org.apache.ignite.examples.datagrid.hibernate.HibernateL2CacheExample;
-
-/**
- * Multi-node test for {@link HibernateL2CacheExample}.
- */
-public class HibernateL2CacheExampleMultiNodeSelfTest extends HibernateL2CacheExampleSelfTest {
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        for (int i = 0; i < RMT_NODES_CNT; i++)
-            startGrid("node-" + i, "examples/config/example-ignite.xml");
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/java/org/apache/ignite/examples/HibernateL2CacheExampleSelfTest.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/java/org/apache/ignite/examples/HibernateL2CacheExampleSelfTest.java b/examples-lgpl/src/test/java/org/apache/ignite/examples/HibernateL2CacheExampleSelfTest.java
deleted file mode 100644
index 68767d7..0000000
--- a/examples-lgpl/src/test/java/org/apache/ignite/examples/HibernateL2CacheExampleSelfTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples;
-
-import org.apache.ignite.examples.datagrid.hibernate.HibernateL2CacheExample;
-import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
-
-/**
- * Tests the {@link HibernateL2CacheExample}.
- */
-public class HibernateL2CacheExampleSelfTest extends GridAbstractExamplesTest {
-    /**
-     * @throws Exception If failed.
-     */
-    public void testHibernateL2CacheExample() throws Exception {
-        HibernateL2CacheExample.main(EMPTY_ARGS);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/java/org/apache/ignite/testsuites/IgniteLgplExamplesSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/java/org/apache/ignite/testsuites/IgniteLgplExamplesSelfTestSuite.java b/examples-lgpl/src/test/java/org/apache/ignite/testsuites/IgniteLgplExamplesSelfTestSuite.java
deleted file mode 100644
index 7c99712..0000000
--- a/examples-lgpl/src/test/java/org/apache/ignite/testsuites/IgniteLgplExamplesSelfTestSuite.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.ignite.testsuites;
-
-import junit.framework.TestSuite;
-import org.apache.ignite.examples.HibernateL2CacheExampleMultiNodeSelfTest;
-import org.apache.ignite.examples.HibernateL2CacheExampleSelfTest;
-import org.apache.ignite.testframework.GridTestUtils;
-
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_OVERRIDE_MCAST_GRP;
-
-/**
- * Examples test suite. <p> Contains only Spring ignite examples tests.
- */
-public class IgniteLgplExamplesSelfTestSuite extends TestSuite {
-    /**
-     * @return Suite.
-     * @throws Exception If failed.
-     */
-    public static TestSuite suite() throws Exception {
-        System.setProperty(IGNITE_OVERRIDE_MCAST_GRP,
-            GridTestUtils.getNextMulticastGroup(IgniteLgplExamplesSelfTestSuite.class));
-
-        TestSuite suite = new TestSuite("Ignite Examples Test Suite");
-
-        suite.addTest(new TestSuite(HibernateL2CacheExampleSelfTest.class));
-
-        // Multi-node.
-        suite.addTest(new TestSuite(HibernateL2CacheExampleMultiNodeSelfTest.class));
-
-        return suite;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/java8/org/apache/ignite/java8/examples/HibernateL2CacheExampleMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/java8/org/apache/ignite/java8/examples/HibernateL2CacheExampleMultiNodeSelfTest.java b/examples-lgpl/src/test/java8/org/apache/ignite/java8/examples/HibernateL2CacheExampleMultiNodeSelfTest.java
deleted file mode 100644
index edfba3d..0000000
--- a/examples-lgpl/src/test/java8/org/apache/ignite/java8/examples/HibernateL2CacheExampleMultiNodeSelfTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.java8.examples;
-
-/**
- * Multi-node test for {@link org.apache.ignite.examples.java8.datagrid.hibernate.HibernateL2CacheExample}.
- */
-public class HibernateL2CacheExampleMultiNodeSelfTest extends HibernateL2CacheExampleSelfTest {
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        for (int i = 0; i < RMT_NODES_CNT; i++)
-            startGrid("node-" + i, "examples/config/example-ignite.xml");
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/java8/org/apache/ignite/java8/examples/HibernateL2CacheExampleSelfTest.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/java8/org/apache/ignite/java8/examples/HibernateL2CacheExampleSelfTest.java b/examples-lgpl/src/test/java8/org/apache/ignite/java8/examples/HibernateL2CacheExampleSelfTest.java
deleted file mode 100644
index 8c7a2de..0000000
--- a/examples-lgpl/src/test/java8/org/apache/ignite/java8/examples/HibernateL2CacheExampleSelfTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.java8.examples;
-
-//import org.apache.ignite.examples.java8.datagrid.hibernate.*;
-
-import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
-
-/**
- * Tests the {@link org.apache.ignite.examples.java8.datagrid.hibernate.HibernateL2CacheExample}.
- */
-public class HibernateL2CacheExampleSelfTest extends GridAbstractExamplesTest {
-    /**
-     * TODO: IGNITE-711 next example(s) should be implemented for java 8
-     * or testing method(s) should be removed if example(s) does not applicable for java 8.
-     *
-     * @throws Exception If failed.
-     */
-//    public void testHibernateL2CacheExample() throws Exception {
-//        HibernateL2CacheExample.main(EMPTY_ARGS);
-//    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/java8/org/apache/ignite/java8/testsuites/IgniteLgplExamplesJ8SelfTestSuite.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/java8/org/apache/ignite/java8/testsuites/IgniteLgplExamplesJ8SelfTestSuite.java b/examples-lgpl/src/test/java8/org/apache/ignite/java8/testsuites/IgniteLgplExamplesJ8SelfTestSuite.java
deleted file mode 100644
index bdda5f6..0000000
--- a/examples-lgpl/src/test/java8/org/apache/ignite/java8/testsuites/IgniteLgplExamplesJ8SelfTestSuite.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.ignite.java8.testsuites;
-
-import junit.framework.TestSuite;
-import org.apache.ignite.testframework.GridTestUtils;
-
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_OVERRIDE_MCAST_GRP;
-
-/**
- * Examples test suite. <p> Contains only Spring ignite examples tests.
- */
-public class IgniteLgplExamplesJ8SelfTestSuite extends TestSuite {
-    /**
-     * @return Suite.
-     * @throws Exception If failed.
-     */
-    public static TestSuite suite() throws Exception {
-        System.setProperty(IGNITE_OVERRIDE_MCAST_GRP,
-            GridTestUtils.getNextMulticastGroup(IgniteLgplExamplesJ8SelfTestSuite.class));
-
-        TestSuite suite = new TestSuite("Ignite Examples Test Suite");
-
-//        suite.addTest(new TestSuite(HibernateL2CacheExampleSelfTest.class));
-
-        // Multi-node.
-//        suite.addTest(new TestSuite(HibernateL2CacheExampleMultiNodeSelfTest.class));
-
-        return suite;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarLgplExamplesMultiNodeSelfTest.scala
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarLgplExamplesMultiNodeSelfTest.scala b/examples-lgpl/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarLgplExamplesMultiNodeSelfTest.scala
deleted file mode 100644
index fca44e3..0000000
--- a/examples-lgpl/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarLgplExamplesMultiNodeSelfTest.scala
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.ignite.scalar.tests.examples
-
-/**
- * Scalar examples multi-node self test.
- */
-class ScalarLgplExamplesMultiNodeSelfTest extends ScalarExamplesSelfTest {
-    /** */
-    protected override def beforeTest() {
-        startRemoteNodes()
-    }
-
-    /** */
-    protected override def getTestTimeout: Long = {
-        10 * 60 * 1000
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarLgplExamplesSelfTest.scala
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarLgplExamplesSelfTest.scala b/examples-lgpl/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarLgplExamplesSelfTest.scala
deleted file mode 100644
index 25a5fe4..0000000
--- a/examples-lgpl/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarLgplExamplesSelfTest.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.ignite.scalar.tests.examples
-
-import org.apache.ignite.scalar.examples._
-import org.apache.ignite.scalar.scalar
-import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest
-import org.scalatest.junit.JUnitSuiteLike
-
-/**
- * Scalar examples self test.
- */
-class ScalarLgplExamplesSelfTest extends GridAbstractExamplesTest with JUnitSuiteLike {
-    /** */
-    private def EMPTY_ARGS = Array.empty[String]
-
-    /** */
-    def testScalarScheduleCallableExample() {
-        ScalarScheduleExample.main(EMPTY_ARGS)
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarLgplExamplesSelfTestSuite.scala
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarLgplExamplesSelfTestSuite.scala b/examples-lgpl/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarLgplExamplesSelfTestSuite.scala
deleted file mode 100644
index 4f3195e..0000000
--- a/examples-lgpl/src/test/scala/org/apache/ignite/scalar/testsuites/ScalarLgplExamplesSelfTestSuite.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.ignite.scalar.testsuites
-
-import org.apache.ignite.IgniteSystemProperties._
-import org.apache.ignite.scalar.tests.examples.{ScalarExamplesMultiNodeSelfTest, ScalarExamplesSelfTest}
-import org.apache.ignite.testframework.GridTestUtils
-import org.junit.runner.RunWith
-import org.scalatest._
-import org.scalatest.junit.JUnitRunner
-
-/**
- *
- */
-@RunWith(classOf[JUnitRunner])
-class ScalarLgplExamplesSelfTestSuite extends Suites(
-    new ScalarLgplExamplesSelfTest,
-    new ScalarLgplExamplesMultiNodeSelfTest
-) {
-    System.setProperty(IGNITE_OVERRIDE_MCAST_GRP,
-        GridTestUtils.getNextMulticastGroup(classOf[ScalarLgplExamplesSelfTest]))
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/README-LGPL.txt
----------------------------------------------------------------------
diff --git a/examples/README-LGPL.txt b/examples/README-LGPL.txt
new file mode 100644
index 0000000..0f95971
--- /dev/null
+++ b/examples/README-LGPL.txt
@@ -0,0 +1,33 @@
+Apache Ignite Examples
+======================
+
+This folder contains code examples for various Apache Ignite functionality.
+
+Examples are shipped as a separate Maven project, so to start running you simply need
+to import provided `pom.xml` file into your favourite IDE.
+
+The examples folder contains he following subfolders:
+
+- `config` - contains Ignite configuration files needed for examples.
+- `memcached` - contains PHP script demonstrating how Ignite Cache can be accessed using Memcached client.
+- `rest` - contains PHP script demonstrating how Ignite Cache can be accessed via HTTP API.
+- `schema-import` - contains demo project for Apache Ignite Schema Import Utility. Refer to enclosed
+  README.txt file for more information on how to build and run the demo.
+- `src/main/java` - contains Java examples for different Ignite modules and features.
+- `src/main/java8` - contains additional set of Java examples utilizing Java 8 lambdas. These examples
+  are excluded by default, enable `java8` Maven profile to include them (JDK8 is required).
+- `src/main/scala` - contains examples demonstrating usage of API provided by Scalar.
+- `src/main/java-lgpl` - contains lgpl-based examples for different Ignite modules and features.
+
+
+Starting Remote Nodes
+=====================
+
+Remote nodes for examples should always be started with special configuration file which enables P2P
+class loading: `examples/config/example-ignite.xml`. To run a remote node in IDE use `ExampleNodeStartup` class.
+
+
+Java7 vs Java8
+===============
+Some examples (not all) which can benefit from Java8 Lambda support were re-written with Java8 lambdas.
+For full set of examples, look at both Java7 and Java8 packages.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/README.txt
----------------------------------------------------------------------
diff --git a/examples/README.txt b/examples/README.txt
index ed26b81..26970d6 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -15,8 +15,9 @@ The examples folder contains he following subfolders:
   README.txt file for more information on how to build and run the demo.
 - `src/main/java` - contains Java examples for different Ignite modules and features.
 - `src/main/java8` - contains additional set of Java examples utilizing Java 8 lambdas. These examples
-  are excluded by default, enable `java8-examples` Maven profile to include them (JDK8 is required).
+  are excluded by default, enable `java8` Maven profile to include them (JDK8 is required).
 - `src/main/scala` - contains examples demonstrating usage of API provided by Scalar.
+- `src/main/java-lgpl` - contains lgpl-based examples for different Ignite modules and features.
 
 
 Starting Remote Nodes
@@ -30,3 +31,21 @@ Java7 vs Java8
 ===============
 Some examples (not all) which can benefit from Java8 Lambda support were re-written with Java8 lambdas.
 For full set of examples, look at both Java7 and Java8 packages.
+
+
+LGPL
+=====
+LGPL examples can be activated by turning lgpl profile on.
+
+lgpl profile required some lgpl-based libs, for example: ignite-hibernate & ignite-schedule.
+In case these libs can not be found by this maven project please download Apache Ignite sources
+at https://ignite.apache.org/download.cgi#sources.
+
+There are some ways to gain required libs from sources:
+
+1) Run "mvn clean install -DskipTests -P lgpl" at Apache Ignite sources.
+This case will install lgpl-based libs to local maven repository.
+
+2) Run "mvn clean package -DskipTests -Prelease,lgpl -Dignite.edition=fabric-lgpl" at Apache Ignite sources.
+Required libs will appear at /target/release-package/libs/optional subfolders.
+Found libs should be copied to global or project's classpath.

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/config/hibernate/README.txt
----------------------------------------------------------------------
diff --git a/examples/config/hibernate/README.txt b/examples/config/hibernate/README.txt
new file mode 100644
index 0000000..5b7ab29
--- /dev/null
+++ b/examples/config/hibernate/README.txt
@@ -0,0 +1,8 @@
+Hibernate L2 Cache Configuration Example
+----------------------------------------
+
+This folder contains example-hibernate-L2-cache.xml file that demonstrates
+how to configure Hibernate to use Apache Ignite cache as an L2 cache provider.
+
+This file is also used in Hibernate example located in org.apache.ignite.examples.datagrid.hibernate
+package.

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/config/hibernate/example-hibernate-L2-cache.xml
----------------------------------------------------------------------
diff --git a/examples/config/hibernate/example-hibernate-L2-cache.xml b/examples/config/hibernate/example-hibernate-L2-cache.xml
new file mode 100644
index 0000000..a2f7e89
--- /dev/null
+++ b/examples/config/hibernate/example-hibernate-L2-cache.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~  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 hibernate-configuration PUBLIC
+    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
+
+<!--
+    Configuration file for HibernateL2CacheExample.
+-->
+
+<hibernate-configuration>
+    <session-factory>
+        <!-- Database connection settings -->
+        <property name="connection.url">jdbc:h2:mem:example;DB_CLOSE_DELAY=-1</property>
+
+        <!-- Drop and re-create the database schema on startup. -->
+        <property name="hbm2ddl.auto">create</property>
+
+        <!-- Enable L2 cache. -->
+        <property name="cache.use_second_level_cache">true</property>
+
+        <!-- Enable query cache. -->
+        <property name="cache.use_query_cache">true</property>
+
+        <!-- Generate L2 cache statistics. -->
+        <property name="generate_statistics">true</property>
+
+        <!-- Specify Ignite as L2 cache provider. -->
+        <property name="cache.region.factory_class">org.apache.ignite.cache.hibernate.HibernateRegionFactory</property>
+
+        <!-- Specify connection release mode. -->
+        <property name="connection.release_mode">on_close</property>
+
+        <!-- Set default L2 cache access type. -->
+        <property name="org.apache.ignite.hibernate.default_access_type">READ_ONLY</property>
+
+        <!-- Specify the entity classes for mapping. -->
+        <mapping class="org.apache.ignite.examples.datagrid.hibernate.User"/>
+        <mapping class="org.apache.ignite.examples.datagrid.hibernate.Post"/>
+
+        <!-- Per-class L2 cache settings. -->
+        <class-cache class="org.apache.ignite.examples.datagrid.hibernate.User" usage="read-only"/>
+        <class-cache class="org.apache.ignite.examples.datagrid.hibernate.Post" usage="read-only"/>
+        <collection-cache collection="org.apache.ignite.examples.datagrid.hibernate.User.posts" usage="read-only"/>
+    </session-factory>
+</hibernate-configuration>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/pom-standalone-lgpl.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone-lgpl.xml b/examples/pom-standalone-lgpl.xml
new file mode 100644
index 0000000..7e7ccc2
--- /dev/null
+++ b/examples/pom-standalone-lgpl.xml
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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.
+-->
+
+<!--
+    POM file.
+-->
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+        <!-- will be changed by profile activation. allows to combine profiles. -->
+        <lgpl.folder>src/main/java</lgpl.folder>
+        <java8.folder>src/main/java</java8.folder>
+        <java.ver>1.7</java.ver>
+    </properties>
+
+    <groupId>org.apache.ignite</groupId>
+    <artifactId>ignite-examples</artifactId>
+    <version>to_be_replaced_by_ignite_version</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.cache</groupId>
+            <artifactId>cache-api</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-core</artifactId>
+            <version>to_be_replaced_by_ignite_version</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-spring</artifactId>
+            <version>to_be_replaced_by_ignite_version</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-log4j</artifactId>
+            <version>to_be_replaced_by_ignite_version</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-indexing</artifactId>
+            <version>to_be_replaced_by_ignite_version</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.code.simple-spring-memcached</groupId>
+            <artifactId>spymemcached</artifactId>
+            <version>2.7.3</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-codec</groupId>
+                    <artifactId>commons-codec</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>java8</id>
+
+            <properties>
+                <java8.folder>src/main/java8</java8.folder>
+                <java.ver>1.8</java.ver>
+            </properties>
+
+            <activation>
+                <jdk>[1.8,)</jdk>
+            </activation>
+        </profile>
+
+        <profile>
+            <id>scala</id>
+
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.ignite</groupId>
+                    <artifactId>ignite-scalar</artifactId>
+                    <version>to_be_replaced_by_ignite_version</version>
+                </dependency>
+            </dependencies>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>net.alchim31.maven</groupId>
+                        <artifactId>scala-maven-plugin</artifactId>
+                        <version>3.2.0</version>
+                        <configuration>
+                            <jvmArgs>
+                                <jvmArg>-Xms512m</jvmArg>
+                                <jvmArg>-Xmx1024m</jvmArg>
+                            </jvmArgs>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>scala-compile-first</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>add-source</goal>
+                                    <goal>compile</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>scala-test-compile</id>
+                                <phase>process-test-resources</phase>
+                                <goals>
+                                    <goal>testCompile</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>lgpl</id>
+
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+
+            <properties>
+                <lgpl.folder>src/main/java-lgpl</lgpl.folder>
+            </properties>
+
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.ignite</groupId>
+                    <artifactId>ignite-hibernate</artifactId>
+                    <version>to_be_replaced_by_ignite_version</version>
+                </dependency>
+
+                <dependency>
+                    <groupId>org.apache.ignite</groupId>
+                    <artifactId>ignite-schedule</artifactId>
+                    <version>to_be_replaced_by_ignite_version</version>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>config</directory>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>${java.ver}</source>
+                    <target>${java.ver}</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-sources</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>schema-import/src/main/java</source>
+                                <source>${lgpl.folder}</source>
+                                <source>${java8.folder}</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/pom-standalone.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone.xml b/examples/pom-standalone.xml
index e314acb..6247ced 100644
--- a/examples/pom-standalone.xml
+++ b/examples/pom-standalone.xml
@@ -28,6 +28,11 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+        <!-- will be changed by profile activation. allows to combine profiles. -->
+        <lgpl.folder>src/main/java</lgpl.folder>
+        <java8.folder>src/main/java</java8.folder>
+        <java.ver>1.7</java.ver>
     </properties>
 
     <groupId>org.apache.ignite</groupId>
@@ -78,84 +83,18 @@
         </dependency>
     </dependencies>
 
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-            <resource>
-                <directory>config</directory>
-            </resource>
-        </resources>
-
-        <plugins>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
-                <configuration>
-                    <source>1.7</source>
-                    <target>1.7</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
     <profiles>
         <profile>
-            <id>java8-examples</id>
+            <id>java8</id>
+
+            <properties>
+                <java8.folder>src/main/java8</java8.folder>
+                <java.ver>1.8</java.ver>
+            </properties>
 
             <activation>
                 <jdk>[1.8,)</jdk>
             </activation>
-
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-compiler-plugin</artifactId>
-                        <version>3.1</version>
-                        <configuration>
-                            <source>1.8</source>
-                            <target>1.8</target>
-                        </configuration>
-                    </plugin>
-
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.9.1</version>
-                        <executions>
-                            <execution>
-                                <id>add-sources</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>add-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/main/java8</source>
-                                        <source>schema-import/src/main/java</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>add-tests</id>
-                                <phase>generate-test-sources</phase>
-                                <goals>
-                                    <goal>add-test-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/test/java8</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
         </profile>
 
         <profile>
@@ -202,5 +141,78 @@
                 </plugins>
             </build>
         </profile>
+
+        <profile>
+            <!-- See README.txt for details -->
+            <id>lgpl</id>
+
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+
+            <properties>
+                <lgpl.folder>src/main/java-lgpl</lgpl.folder>
+            </properties>
+
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.ignite</groupId>
+                    <artifactId>ignite-hibernate</artifactId>
+                    <version>to_be_replaced_by_ignite_version</version>
+                </dependency>
+
+                <dependency>
+                    <groupId>org.apache.ignite</groupId>
+                    <artifactId>ignite-schedule</artifactId>
+                    <version>to_be_replaced_by_ignite_version</version>
+                </dependency>
+            </dependencies>
+        </profile>
     </profiles>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>config</directory>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>${java.ver}</source>
+                    <target>${java.ver}</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-sources</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>schema-import/src/main/java</source>
+                                <source>${lgpl.folder}</source>
+                                <source>${java8.folder}</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 34ba05a..5129e7f 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -17,7 +17,8 @@
   limitations under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
@@ -62,6 +63,18 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-hibernate</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-schedule</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
             <groupId>com.google.code.simple-spring-memcached</groupId>
             <artifactId>spymemcached</artifactId>
             <version>2.7.3</version>
@@ -89,41 +102,13 @@
         </dependency>
     </dependencies>
 
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-            <resource>
-                <directory>config</directory>
-            </resource>
-        </resources>
-
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <version>1.9.1</version>
-                <executions>
-                    <execution>
-                        <id>add-sources</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>add-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>schema-import/src/main/java</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
+    <properties>
+        <!-- will be changed by profile activation. allows to combine profiles. -->
+        <lgpl.folder>src/main/java</lgpl.folder>
+        <java8.folder>src/main/java</java8.folder>
+        <lgpl.test.folder>src/test/java</lgpl.test.folder>
+        <java8.test.folder>src/test/java</java8.test.folder>
+    </properties>
 
     <profiles>
         <profile>
@@ -195,7 +180,12 @@
         </profile>
 
         <profile>
-            <id>java8-examples</id>
+            <id>java8</id>
+
+            <properties>
+                <java8.folder>src/main/java8</java8.folder>
+                <java8.test.folder>src/test/java8</java8.test.folder>
+            </properties>
 
             <activation>
                 <jdk>[1.8,)</jdk>
@@ -210,41 +200,68 @@
                             <target>1.8</target>
                         </configuration>
                     </plugin>
-
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.9.1</version>
-                        <executions>
-                            <execution>
-                                <id>add-sources</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>add-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/main/java8</source>
-                                        <source>schema-import/src/main/java</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>add-tests</id>
-                                <phase>generate-test-sources</phase>
-                                <goals>
-                                    <goal>add-test-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/test/java8</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
                 </plugins>
             </build>
         </profile>
+
+        <profile>
+            <id>lgpl</id>
+
+            <properties>
+                <lgpl.folder>src/main/java-lgpl</lgpl.folder>
+                <lgpl.test.folder>src/test/java-lgpl</lgpl.test.folder>
+            </properties>
+        </profile>
     </profiles>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>config</directory>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-sources</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>schema-import/src/main/java</source>
+                                <source>${lgpl.folder}</source>
+                                <source>${java8.folder}</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+
+                    <execution>
+                        <id>add-tests</id>
+                        <phase>generate-test-sources</phase>
+                        <goals>
+                            <goal>add-test-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${lgpl.test.folder}</source>
+                                <source>${java8.test.folder}</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
new file mode 100644
index 0000000..2f271c8
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
@@ -0,0 +1,245 @@
+/*
+ * 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.examples.datagrid.hibernate;
+
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.examples.ExampleNodeStartup;
+import org.apache.ignite.examples.ExamplesUtils;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.cache.spi.access.AccessType;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.service.ServiceRegistryBuilder;
+import org.hibernate.stat.SecondLevelCacheStatistics;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/**
+ * This example demonstrates the use of Ignite In-Memory Data Ignite cluster as a Hibernate
+ * Second-Level cache provider.
+ * <p>
+ * The Hibernate Second-Level cache (or "L2 cache" shortly) lets you significantly
+ * reduce the number of requests to the underlying SQL database. Because database
+ * access is known to be an expansive operation, using L2 cache may improve
+ * performance dramatically.
+ * <p>
+ * This example defines 2 entity classes: {@link User} and {@link Post}, with
+ * 1 <-> N relation, and marks them with appropriate annotations for Hibernate
+ * object-relational mapping to SQL tables of an underlying H2 in-memory database.
+ * The example launches node in the same JVM and registers it in
+ * Hibernate configuration as an L2 cache implementation. It then stores and
+ * queries instances of the entity classes to and from the database, having
+ * Hibernate SQL output, L2 cache statistics output, and Ignite cache metrics
+ * output enabled.
+ * <p>
+ * When running example, it's easy to notice that when an object is first
+ * put into a database, the L2 cache is not used and it's contents is empty.
+ * However, when an object is first read from the database, it is immediately
+ * stored in L2 cache (which is Ignite In-Memory Data Ignite cluster in fact), which can
+ * be seen in stats output. Further requests of the same object only read the data
+ * from L2 cache and do not hit the database.
+ * <p>
+ * In this example, the Hibernate query cache is also enabled. Query cache lets you
+ * avoid hitting the database in case of repetitive queries with the same parameter
+ * values. You may notice that when the example runs the same query repeatedly in
+ * loop, only the first query hits the database and the successive requests take the
+ * data from L2 cache.
+ * <p>
+ * Note: this example uses {@link AccessType#READ_ONLY} L2 cache access type, but you
+ * can experiment with other access types by modifying the Hibernate configuration file
+ * {@code IGNITE_HOME/examples/config/hibernate/example-hibernate-L2-cache.xml}, used by the example.
+ * <p>
+ * Remote nodes should always be started with special configuration file which
+ * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
+ * <p>
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will
+ * start node with {@code examples/config/example-ignite.xml} configuration.
+ */
+public class HibernateL2CacheExample {
+    /** JDBC URL for backing database (an H2 in-memory database is used). */
+    private static final String JDBC_URL = "jdbc:h2:mem:example;DB_CLOSE_DELAY=-1";
+
+    /** Path to hibernate configuration file (will be resolved from application {@code CLASSPATH}). */
+    private static final String HIBERNATE_CFG = "hibernate/example-hibernate-L2-cache.xml";
+
+    /** Entity names for stats output. */
+    private static final List<String> ENTITY_NAMES =
+        Arrays.asList(User.class.getName(), Post.class.getName(), User.class.getName() + ".posts");
+
+    /**
+     * Executes example.
+     *
+     * @param args Command line arguments, none required.
+     * @throws IgniteException If example execution failed.
+     */
+    public static void main(String[] args) throws IgniteException {
+        // Start the node, run the example, and stop the node when finished.
+        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
+            // We use a single session factory, but create a dedicated session
+            // for each transaction or query. This way we ensure that L1 cache
+            // is not used (L1 cache has per-session scope only).
+            System.out.println();
+            System.out.println(">>> Hibernate L2 cache example started.");
+
+            try (
+                // Create all required caches.
+                IgniteCache c1 = createCache("org.hibernate.cache.spi.UpdateTimestampsCache", ATOMIC);
+                IgniteCache c2 = createCache("org.hibernate.cache.internal.StandardQueryCache", ATOMIC);
+                IgniteCache c3 = createCache("org.apache.ignite.examples.datagrid.hibernate.User", TRANSACTIONAL);
+                IgniteCache c4 = createCache("org.apache.ignite.examples.datagrid.hibernate.User.posts", TRANSACTIONAL);
+                IgniteCache c5 = createCache("org.apache.ignite.examples.datagrid.hibernate.Post", TRANSACTIONAL)
+            ) {
+                URL hibernateCfg = ExamplesUtils.url(HIBERNATE_CFG);
+
+                SessionFactory sesFactory = createHibernateSessionFactory(hibernateCfg);
+
+                System.out.println();
+                System.out.println(">>> Creating objects.");
+
+                final long userId;
+
+                Session ses = sesFactory.openSession();
+
+                try {
+                    Transaction tx = ses.beginTransaction();
+
+                    User user = new User("jedi", "Luke", "Skywalker");
+
+                    user.getPosts().add(new Post(user, "Let the Force be with you."));
+
+                    ses.save(user);
+
+                    tx.commit();
+
+                    // Create a user object, store it in DB, and save the database-generated
+                    // object ID. You may try adding more objects in a similar way.
+                    userId = user.getId();
+                }
+                finally {
+                    ses.close();
+                }
+
+                // Output L2 cache and Ignite cache stats. You may notice that
+                // at this point the object is not yet stored in L2 cache, because
+                // the read was not yet performed.
+                printStats(sesFactory);
+
+                System.out.println();
+                System.out.println(">>> Querying object by ID.");
+
+                // Query user by ID several times. First time we get an L2 cache
+                // miss, and the data is queried from DB, but it is then stored
+                // in cache and successive queries hit the cache and return
+                // immediately, no SQL query is made.
+                for (int i = 0; i < 3; i++) {
+                    ses = sesFactory.openSession();
+
+                    try {
+                        Transaction tx = ses.beginTransaction();
+
+                        User user = (User)ses.get(User.class, userId);
+
+                        System.out.println("User: " + user);
+
+                        for (Post post : user.getPosts())
+                            System.out.println("\tPost: " + post);
+
+                        tx.commit();
+                    }
+                    finally {
+                        ses.close();
+                    }
+                }
+
+                // Output the stats. We should see 1 miss and 2 hits for
+                // User and Collection object (stored separately in L2 cache).
+                // The Post is loaded with the collection, so it won't imply
+                // a miss.
+                printStats(sesFactory);
+            }
+        }
+    }
+
+    /**
+     * Creates cache.
+     *
+     * @param name Cache name.
+     * @param atomicityMode Atomicity mode.
+     * @return Cache configuration.
+     */
+    private static IgniteCache createCache(String name, CacheAtomicityMode atomicityMode) {
+        CacheConfiguration ccfg = new CacheConfiguration(name);
+
+        ccfg.setAtomicityMode(atomicityMode);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+
+        return Ignition.ignite().getOrCreateCache(ccfg);
+    }
+
+    /**
+     * Creates a new Hibernate {@link SessionFactory} using a programmatic
+     * configuration.
+     *
+     * @param hibernateCfg Hibernate configuration file.
+     * @return New Hibernate {@link SessionFactory}.
+     */
+    private static SessionFactory createHibernateSessionFactory(URL hibernateCfg) {
+        ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
+
+        builder.applySetting("hibernate.connection.url", JDBC_URL);
+        builder.applySetting("hibernate.show_sql", true);
+
+        return new Configuration()
+            .configure(hibernateCfg)
+            .buildSessionFactory(builder.buildServiceRegistry());
+    }
+
+    /**
+     * Prints Hibernate L2 cache statistics to standard output.
+     *
+     * @param sesFactory Hibernate {@link SessionFactory}, for which to print
+     *                   statistics.
+     */
+    private static void printStats(SessionFactory sesFactory) {
+        System.out.println("=== Hibernate L2 cache statistics ===");
+
+        for (String entityName : ENTITY_NAMES) {
+            System.out.println("\tEntity: " + entityName);
+
+            SecondLevelCacheStatistics stats =
+                sesFactory.getStatistics().getSecondLevelCacheStatistics(entityName);
+
+            System.out.println("\t\tL2 cache entries: " + stats.getEntries());
+            System.out.println("\t\tHits: " + stats.getHitCount());
+            System.out.println("\t\tMisses: " + stats.getMissCount());
+        }
+
+        System.out.println("=====================================");
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/Post.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/Post.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/Post.java
new file mode 100644
index 0000000..8e98835
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/Post.java
@@ -0,0 +1,130 @@
+/*
+ * 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.examples.datagrid.hibernate;
+
+import java.util.Date;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+
+/**
+ * An entity class representing a post, that a
+ * {@link User} has made on some public service.
+ */
+@Entity
+class Post {
+    /** ID. */
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    private long id;
+
+    /** Author. */
+    @ManyToOne
+    private User author;
+
+    /** Text. */
+    private String text;
+
+    /** Created timestamp. */
+    private Date created;
+
+    /**
+     * Default constructor (required by Hibernate).
+     */
+    Post() {
+        // No-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param author Author.
+     * @param text Text.
+     */
+    Post(User author, String text) {
+        this.author = author;
+        this.text = text;
+        created = new Date();
+    }
+
+    /**
+     * @return ID.
+     */
+    public long getId() {
+        return id;
+    }
+
+    /**
+     * @param id New ID.
+     */
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    /**
+     * @return Author.
+     */
+    public User getAuthor() {
+        return author;
+    }
+
+    /**
+     * @param author New author.
+     */
+    public void setAuthor(User author) {
+        this.author = author;
+    }
+
+    /**
+     * @return Text.
+     */
+    public String getText() {
+        return text;
+    }
+
+    /**
+     * @param text New text.
+     */
+    public void setText(String text) {
+        this.text = text;
+    }
+
+    /**
+     * @return Created timestamp.
+     */
+    public Date getCreated() {
+        return (Date)created.clone();
+    }
+
+    /**
+     * @param created New created timestamp.
+     */
+    public void setCreated(Date created) {
+        this.created = (Date)created.clone();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return "Post [id=" + id +
+            ", text=" + text +
+            ", created=" + created +
+            ']';
+    }
+}


[06/16] ignite git commit: fixed GridUriDeploymentClassLoaderSelfTest#testNestedJarClassloading

Posted by dm...@apache.org.
fixed GridUriDeploymentClassLoaderSelfTest#testNestedJarClassloading

Signed-off-by: Anton Vinogradov <av...@apache.org>


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

Branch: refs/heads/ignite-801
Commit: ea63c2dc5e326c98b5091c9bf04d348efb92e8fe
Parents: bd2cd92
Author: ashutak <as...@gridgain.com>
Authored: Mon Oct 19 20:30:55 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Oct 26 18:03:46 2015 +0300

----------------------------------------------------------------------
 modules/core/src/test/config/tests.properties |  4 ++--
 modules/extdata/uri/pom.xml                   | 21 +++++++++++----------
 2 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ea63c2dc/modules/core/src/test/config/tests.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/tests.properties b/modules/core/src/test/config/tests.properties
index 49e616e..3275c3c 100644
--- a/modules/core/src/test/config/tests.properties
+++ b/modules/core/src/test/config/tests.properties
@@ -67,8 +67,8 @@ ant.gar.srcdir=@{IGNITE_HOME}/modules/extdata/uri/target/classes/
 # GAR paths to use in URI deployment SPI tests
 ant.urideployment.gar.uri=file://freq=5000@localhost/EXTDATA/uri/target/deploy
 ant.urideployment.gar.file=modules/extdata/uri/target/deploy/uri.gar
-ant.urideployment.gar.libs-file=modules/extdata/uri/target/deploy/uri-libs.gar
-ant.urideployment.gar.classes-file=modules/extdata/uri/target/deploy/uri-classes.gar
+ant.urideployment.gar.libs-file=modules/extdata/uri/target/deploy2/uri-libs.gar
+ant.urideployment.gar.classes-file=modules/extdata/uri/target/deploy2/uri-classes.gar
 ant.urideployment.gar.path=modules/extdata/uri/target/deploy/
 ant.urideployment.gar.path.tmp=modules/extdata/uri/target/deploy_tmp/
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ea63c2dc/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index d5e6349..c5fb5cf 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -136,6 +136,8 @@
                         <phase>compile</phase>
                         <configuration>
                             <target>
+                                <taskdef name="gar" classname="org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask" />
+
                                 <!-- copying resources to classes -->
                                 <copy todir="${basedir}/target/classes">
                                     <fileset dir="${basedir}/src/main/java">
@@ -144,23 +146,22 @@
                                     </fileset>
                                 </copy>
 
-                                <copy file="${settings.localRepository}/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar" todir="${basedir}/target/libs" />
+                                <mkdir dir="${basedir}/target/deploy_tmp/"/>
+
+                                <!--uri-classes.gar-->
+                                <gar destfile="${basedir}/target/deploy2/uri-classes.gar" basedir="${basedir}/target/classes" />
 
+                                <!--Copy libs.-->
                                 <zip destfile="${basedir}/target/classes/lib/depend.jar" encoding="UTF-8">
                                     <zipfileset dir="modules/uri-dependency/target/classes" />
                                 </zip>
 
-                                <copy file="${basedir}/target/classes/lib/depend.jar" todir="${basedir}/target/libs" />
-
-                                <mkdir dir="${basedir}/target/deploy_tmp/"/>
-
-                                <taskdef name="gar" classname="org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask" />
-
-                                <gar destfile="${basedir}/target/deploy/uri-classes.gar" basedir="${basedir}/target/classes" />
-                                <gar destfile="${basedir}/target/deploy/uri-libs.gar" basedir="${basedir}/target/libs" />
-
                                 <copy file="${settings.localRepository}/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar" todir="${basedir}/target/classes/lib" />
 
+                                <!--uri-libs.gar-->
+                                <gar destfile="${basedir}/target/deploy2/uri-libs.gar" basedir="${basedir}/target/classes/lib" />
+
+                                <!--uri.gar-->
                                 <gar destfile="${basedir}/target/deploy/uri.gar" basedir="${basedir}/target/classes" />
 
                                 <!--


[05/16] ignite git commit: IGNITE-1653

Posted by dm...@apache.org.
IGNITE-1653


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

Branch: refs/heads/ignite-801
Commit: bd2cd92349cf369f6a2f8b634591e180d8acfb58
Parents: 15cc1bd
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Oct 26 17:24:35 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Oct 26 17:24:35 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |   2 +-
 assembly/dependencies-fabric-lgpl.xml           | 169 +++++++++++++
 assembly/dependencies-fabric.xml                |   3 +
 assembly/release-fabric-base.xml                | 107 ++++++++
 assembly/release-fabric-lgpl.xml                |  41 ++--
 assembly/release-fabric.xml                     |  85 +------
 assembly/release-hadoop-lgpl.xml                |  39 ---
 config/fabric-lgpl/default-config.xml           |  29 +++
 examples-lgpl/README.txt                        |  27 --
 examples-lgpl/config/example-cache.xml          |  73 ------
 examples-lgpl/config/example-ignite.xml         |  83 -------
 examples-lgpl/config/hibernate/README.txt       |   8 -
 .../hibernate/example-hibernate-L2-cache.xml    |  64 -----
 examples-lgpl/pom-standalone.xml                | 186 --------------
 examples-lgpl/pom.xml                           | 128 ----------
 .../hibernate/HibernateL2CacheExample.java      | 245 -------------------
 .../examples/datagrid/hibernate/Post.java       | 130 ----------
 .../examples/datagrid/hibernate/User.java       | 154 ------------
 .../datagrid/hibernate/package-info.java        |  22 --
 .../hibernate/CacheHibernatePersonStore.java    | 122 ---------
 .../hibernate/CacheHibernateStoreExample.java   | 151 ------------
 .../datagrid/store/hibernate/Person.hbm.xml     |  34 ---
 .../datagrid/store/hibernate/hibernate.cfg.xml  |  41 ----
 .../datagrid/store/hibernate/package-info.java  |  22 --
 .../misc/schedule/ComputeScheduleExample.java   |  82 -------
 .../examples/misc/schedule/package-info.java    |  22 --
 .../misc/schedule/ComputeScheduleExample.java   |  68 -----
 .../java8/misc/schedule/package-info.java       |  22 --
 .../ignite/examples/java8/package-info.java     |  23 --
 .../scalar/examples/ScalarScheduleExample.scala |  66 -----
 ...ibernateL2CacheExampleMultiNodeSelfTest.java |  31 ---
 .../HibernateL2CacheExampleSelfTest.java        |  33 ---
 .../IgniteLgplExamplesSelfTestSuite.java        |  48 ----
 ...ibernateL2CacheExampleMultiNodeSelfTest.java |  29 ---
 .../HibernateL2CacheExampleSelfTest.java        |  37 ---
 .../IgniteLgplExamplesJ8SelfTestSuite.java      |  46 ----
 .../ScalarLgplExamplesMultiNodeSelfTest.scala   |  33 ---
 .../examples/ScalarLgplExamplesSelfTest.scala   |  36 ---
 .../ScalarLgplExamplesSelfTestSuite.scala       |  37 ---
 examples/README-LGPL.txt                        |  33 +++
 examples/README.txt                             |  21 +-
 examples/config/hibernate/README.txt            |   8 +
 .../hibernate/example-hibernate-L2-cache.xml    |  64 +++++
 examples/pom-standalone-lgpl.xml                | 217 ++++++++++++++++
 examples/pom-standalone.xml                     | 156 ++++++------
 examples/pom.xml                                | 157 ++++++------
 .../hibernate/HibernateL2CacheExample.java      | 245 +++++++++++++++++++
 .../examples/datagrid/hibernate/Post.java       | 130 ++++++++++
 .../examples/datagrid/hibernate/User.java       | 154 ++++++++++++
 .../datagrid/hibernate/package-info.java        |  22 ++
 .../hibernate/CacheHibernatePersonStore.java    | 122 +++++++++
 .../hibernate/CacheHibernateStoreExample.java   | 151 ++++++++++++
 .../datagrid/store/hibernate/Person.hbm.xml     |  34 +++
 .../datagrid/store/hibernate/hibernate.cfg.xml  |  41 ++++
 .../datagrid/store/hibernate/package-info.java  |  22 ++
 .../misc/schedule/ComputeScheduleExample.java   |  82 +++++++
 .../examples/misc/schedule/package-info.java    |  22 ++
 ...ibernateL2CacheExampleMultiNodeSelfTest.java |  31 +++
 .../HibernateL2CacheExampleSelfTest.java        |  33 +++
 .../IgniteLgplExamplesSelfTestSuite.java        |  48 ++++
 pom.xml                                         |  64 -----
 61 files changed, 1977 insertions(+), 2458 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index a6c45f0..e8e3741 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -7,7 +7,7 @@ Without LGPL dependencies and Scala 2.10:
   mvn clean package -DskipTests -Dscala-2.10
 
 With LGPL dependencies:
-  mvn clean package -DskipTests -Prelease,lgpl
+  mvn clean package -DskipTests -Prelease,lgpl -Dignite.edition=fabric-lgpl
 
 With LGPL dependencies and Scala 2.10:
   mvn clean package -DskipTests -Prelease,lgpl -Dscala-2.10

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/assembly/dependencies-fabric-lgpl.xml
----------------------------------------------------------------------
diff --git a/assembly/dependencies-fabric-lgpl.xml b/assembly/dependencies-fabric-lgpl.xml
new file mode 100644
index 0000000..f50847e
--- /dev/null
+++ b/assembly/dependencies-fabric-lgpl.xml
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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.
+-->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
+          http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+    <id>dependencies</id>
+
+    <formats>
+        <format>dir</format>
+    </formats>
+
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <moduleSets>
+        <moduleSet>
+            <includes>
+                <include>org.apache.ignite:ignite-spring</include>
+                <include>org.apache.ignite:ignite-indexing</include>
+            </includes>
+            <sources>
+                <includeModuleDirectory>true</includeModuleDirectory>
+                <fileSets>
+                    <fileSet>
+                        <directory>${basedir}</directory>
+                        <outputDirectory>/</outputDirectory>
+                        <includes>
+                            <include>README.txt</include>
+                            <include>licenses/**</include>
+                        </includes>
+                    </fileSet>
+                    <fileSet>
+                        <directory>${basedir}/target/licenses</directory>
+                        <outputDirectory>/licenses</outputDirectory>
+                    </fileSet>
+                    <fileSet>
+                        <directory>target/libs</directory>
+                        <outputDirectory>/</outputDirectory>
+                    </fileSet>
+                    <fileSet>
+                        <directory>target</directory>
+                        <outputDirectory>/</outputDirectory>
+                        <includes>
+                            <include>*.jar</include>
+                        </includes>
+                        <excludes>
+                            <exclude>*-tests.jar</exclude>
+                            <exclude>*-javadoc.jar</exclude>
+                            <exclude>*-sources.jar</exclude>
+                        </excludes>
+                    </fileSet>
+                </fileSets>
+            </sources>
+        </moduleSet>
+
+        <moduleSet>
+            <includes>
+                <include>org.apache.ignite:ignite-core</include>
+            </includes>
+            <sources>
+                <includeModuleDirectory>false</includeModuleDirectory>
+                <fileSets>
+                    <fileSet>
+                        <directory>${basedir}</directory>
+                        <outputDirectory>/</outputDirectory>
+                        <includes>
+                            <include>README.txt</include>
+                            <include>licenses/**</include>
+                        </includes>
+                    </fileSet>
+                    <fileSet>
+                        <directory>${basedir}/target/licenses</directory>
+                        <outputDirectory>/licenses</outputDirectory>
+                    </fileSet>
+                    <fileSet>
+                        <directory>target/libs</directory>
+                        <outputDirectory>/</outputDirectory>
+                    </fileSet>
+                    <fileSet>
+                        <directory>target</directory>
+                        <outputDirectory>/</outputDirectory>
+                        <includes>
+                            <include>*.jar</include>
+                        </includes>
+                        <excludes>
+                            <exclude>*-tests.jar</exclude>
+                            <exclude>*-javadoc.jar</exclude>
+                            <exclude>*-sources.jar</exclude>
+                        </excludes>
+                    </fileSet>
+                </fileSets>
+            </sources>
+        </moduleSet>
+
+        <moduleSet>
+            <includeSubModules>true</includeSubModules>
+            <excludes>
+                <exclude>org.apache.ignite:ignite-core</exclude>
+                <exclude>org.apache.ignite:ignite-clients</exclude>
+                <exclude>org.apache.ignite:ignite-spring</exclude>
+                <exclude>org.apache.ignite:ignite-tools</exclude>
+                <exclude>org.apache.ignite:ignite-extdata-p2p</exclude>
+                <exclude>org.apache.ignite:ignite-extdata-uri</exclude>
+                <exclude>org.apache.ignite:ignite-extdata-uri-dep</exclude>
+                <exclude>org.apache.ignite:ignite-examples</exclude>
+                <exclude>org.apache.ignite:ignite-schema-import-demo</exclude>
+                <exclude>org.apache.ignite:ignite-indexing</exclude>
+                <exclude>org.apache.ignite:ignite-visor-console</exclude>
+                <exclude>org.apache.ignite:ignite-visor-console_2.10</exclude>
+                <exclude>org.apache.ignite:ignite-visor-plugins</exclude>
+                <exclude>org.apache.ignite:ignite-hadoop</exclude>
+                <exclude>org.apache.ignite:ignite-schema-import</exclude>
+                <exclude>org.apache.ignite:ignite-codegen</exclude>
+                <exclude>org.apache.ignite:ignite-apache-license-gen</exclude>
+            </excludes>
+            <sources>
+                <includeModuleDirectory>true</includeModuleDirectory>
+                <outputDirectoryMapping>optional/${module.artifactId}</outputDirectoryMapping>
+                <fileSets>
+                    <fileSet>
+                        <directory>${basedir}</directory>
+                        <outputDirectory>/</outputDirectory>
+                        <includes>
+                            <include>README.txt</include>
+                            <include>licenses/**</include>
+                        </includes>
+                    </fileSet>
+                    <fileSet>
+                        <directory>${basedir}/target/licenses</directory>
+                        <outputDirectory>/licenses</outputDirectory>
+                    </fileSet>
+                    <fileSet>
+                        <directory>target/libs</directory>
+                        <outputDirectory>/</outputDirectory>
+                    </fileSet>
+                    <fileSet>
+                        <directory>target</directory>
+                        <outputDirectory>/</outputDirectory>
+                        <includes>
+                            <include>*.jar</include>
+                        </includes>
+                        <excludes>
+                            <exclude>*-tests.jar</exclude>
+                            <exclude>*-javadoc.jar</exclude>
+                            <exclude>*-sources.jar</exclude>
+                        </excludes>
+                    </fileSet>
+                </fileSets>
+            </sources>
+        </moduleSet>
+    </moduleSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/assembly/dependencies-fabric.xml
----------------------------------------------------------------------
diff --git a/assembly/dependencies-fabric.xml b/assembly/dependencies-fabric.xml
index f50847e..5fb7cb1 100644
--- a/assembly/dependencies-fabric.xml
+++ b/assembly/dependencies-fabric.xml
@@ -129,6 +129,9 @@
                 <exclude>org.apache.ignite:ignite-schema-import</exclude>
                 <exclude>org.apache.ignite:ignite-codegen</exclude>
                 <exclude>org.apache.ignite:ignite-apache-license-gen</exclude>
+                <exclude>org.apache.ignite:ignite-hibernate</exclude>
+                <exclude>org.apache.ignite:ignite-schedule</exclude>
+                <exclude>org.apache.ignite:ignite-geospatial</exclude>
             </excludes>
             <sources>
                 <includeModuleDirectory>true</includeModuleDirectory>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/assembly/release-fabric-base.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric-base.xml b/assembly/release-fabric-base.xml
new file mode 100644
index 0000000..944e8ce
--- /dev/null
+++ b/assembly/release-fabric-base.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~  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.
+  -->
+
+<component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2
+           http://maven.apache.org/xsd/component-1.1.2.xsd">
+    <files>
+        <file>
+            <source>assembly/LICENSE_FABRIC</source>
+            <destName>LICENSE</destName>
+            <outputDirectory>/</outputDirectory>
+        </file>
+
+        <file>
+            <source>assembly/NOTICE_FABRIC</source>
+            <destName>NOTICE</destName>
+            <outputDirectory>/</outputDirectory>
+        </file>
+
+        <file>
+            <source>examples/schema-import/pom-standalone.xml</source>
+            <outputDirectory>/examples/schema-import</outputDirectory>
+            <destName>pom.xml</destName>
+        </file>
+    </files>
+
+    <fileSets>
+        <fileSet>
+            <directory>bin</directory>
+            <outputDirectory>/bin</outputDirectory>
+            <includes>
+                <include>igniterouter.bat</include>
+            </includes>
+        </fileSet>
+
+        <fileSet>
+            <directory>bin</directory>
+            <outputDirectory>/bin</outputDirectory>
+            <fileMode>0755</fileMode>
+            <includes>
+                <include>igniterouter.sh</include>
+            </includes>
+        </fileSet>
+
+        <fileSet>
+            <directory>config/router</directory>
+            <outputDirectory>/config/router</outputDirectory>
+        </fileSet>
+
+        <fileSet>
+            <directory>examples</directory>
+            <outputDirectory>/examples</outputDirectory>
+            <includes>
+                <include>rest/**</include>
+                <include>memcached/**</include>
+                <include>schema-import/src/**</include>
+                <include>schema-import/bin/**</include>
+                <include>schema-import/README.txt</include>
+            </includes>
+        </fileSet>
+
+        <fileSet>
+            <directory>target/javadoc/core</directory>
+            <outputDirectory>/docs/javadoc</outputDirectory>
+        </fileSet>
+
+        <fileSet>
+            <directory>modules/scalar/target/site/scaladocs</directory>
+            <outputDirectory>/docs/scaladoc/scalar</outputDirectory>
+        </fileSet>
+
+        <fileSet>
+            <directory>examples</directory>
+            <outputDirectory>/examples</outputDirectory>
+            <includes>
+                <include>config/**</include>
+                <include>src/**</include>
+            </includes>
+            <excludes>
+                <exclude>**/package.html</exclude>
+                <exclude>src/test/**</exclude>
+            </excludes>
+        </fileSet>
+
+        <fileSet>
+            <directory>assembly/libs</directory>
+            <outputDirectory>/libs</outputDirectory>
+        </fileSet>
+    </fileSets>
+</component>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/assembly/release-fabric-lgpl.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric-lgpl.xml b/assembly/release-fabric-lgpl.xml
index b8757db..1766558 100644
--- a/assembly/release-fabric-lgpl.xml
+++ b/assembly/release-fabric-lgpl.xml
@@ -21,7 +21,7 @@
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
           http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-    <id>fabric</id>
+    <id>fabric-lgpl</id>
 
     <includeBaseDirectory>false</includeBaseDirectory>
 
@@ -29,35 +29,22 @@
         <format>dir</format>
     </formats>
 
+    <componentDescriptors>
+        <componentDescriptor>release-base.xml</componentDescriptor>
+        <componentDescriptor>release-fabric-base.xml</componentDescriptor>
+    </componentDescriptors>
+
     <files>
         <file>
-            <source>examples-lgpl/pom-standalone.xml</source>
-            <outputDirectory>/examples-lgpl</outputDirectory>
+            <source>examples/pom-standalone-lgpl.xml</source>
+            <outputDirectory>/examples</outputDirectory>
             <destName>pom.xml</destName>
         </file>
-    </files>
 
-    <fileSets>
-        <fileSet>
-            <directory>examples-lgpl</directory>
-            <outputDirectory>/examples-lgpl</outputDirectory>
-            <includes>
-                <include>README.txt</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>examples-lgpl</directory>
-            <outputDirectory>/examples-lgpl</outputDirectory>
-            <includes>
-                <include>config/**</include>
-                <include>src/**</include>
-            </includes>
-            <excludes>
-                <exclude>**/package.html</exclude>
-                <exclude>pom-standalone.xml</exclude>
-                <exclude>src/test/**</exclude>
-            </excludes>
-        </fileSet>
-    </fileSets>
+        <file>
+            <source>examples/README-LGPL.txt</source>
+            <outputDirectory>/examples</outputDirectory>
+            <destName>README.txt</destName>
+        </file>
+    </files>
 </assembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/assembly/release-fabric.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric.xml b/assembly/release-fabric.xml
index 9f9fbb2..ffde8ec 100644
--- a/assembly/release-fabric.xml
+++ b/assembly/release-fabric.xml
@@ -31,97 +31,20 @@
 
     <componentDescriptors>
         <componentDescriptor>release-base.xml</componentDescriptor>
+        <componentDescriptor>release-fabric-base.xml</componentDescriptor>
     </componentDescriptors>
 
     <files>
         <file>
-            <source>assembly/LICENSE_FABRIC</source>
-            <destName>LICENSE</destName>
-            <outputDirectory>/</outputDirectory>
-        </file>
-
-        <file>
-            <source>assembly/NOTICE_FABRIC</source>
-            <destName>NOTICE</destName>
-            <outputDirectory>/</outputDirectory>
-        </file>
-
-        <file>
             <source>examples/pom-standalone.xml</source>
             <outputDirectory>/examples</outputDirectory>
             <destName>pom.xml</destName>
         </file>
 
         <file>
-            <source>examples/schema-import/pom-standalone.xml</source>
-            <outputDirectory>/examples/schema-import</outputDirectory>
-            <destName>pom.xml</destName>
+            <source>examples/README.txt</source>
+            <outputDirectory>/examples</outputDirectory>
+            <destName>README.txt</destName>
         </file>
     </files>
-
-    <fileSets>
-        <fileSet>
-            <directory>bin</directory>
-            <outputDirectory>/bin</outputDirectory>
-            <includes>
-                <include>igniterouter.bat</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>bin</directory>
-            <outputDirectory>/bin</outputDirectory>
-            <fileMode>0755</fileMode>
-            <includes>
-                <include>igniterouter.sh</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>config/router</directory>
-            <outputDirectory>/config/router</outputDirectory>
-        </fileSet>
-
-        <fileSet>
-            <directory>examples</directory>
-            <outputDirectory>/examples</outputDirectory>
-            <includes>
-                <include>rest/**</include>
-                <include>memcached/**</include>
-                <include>schema-import/src/**</include>
-                <include>schema-import/bin/**</include>
-                <include>schema-import/README.txt</include>
-                <include>README.txt</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>target/javadoc/core</directory>
-            <outputDirectory>/docs/javadoc</outputDirectory>
-        </fileSet>
-
-        <fileSet>
-            <directory>modules/scalar/target/site/scaladocs</directory>
-            <outputDirectory>/docs/scaladoc/scalar</outputDirectory>
-        </fileSet>
-
-        <fileSet>
-            <directory>examples</directory>
-            <outputDirectory>/examples</outputDirectory>
-            <includes>
-                <include>config/**</include>
-                <include>src/**</include>
-            </includes>
-            <excludes>
-                <exclude>**/package.html</exclude>
-                <exclude>pom-standalone.xml</exclude>
-                <exclude>src/test/**</exclude>
-            </excludes>
-        </fileSet>
-
-        <fileSet>
-            <directory>assembly/libs</directory>
-            <outputDirectory>/libs</outputDirectory>
-        </fileSet>
-    </fileSets>
 </assembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/assembly/release-hadoop-lgpl.xml
----------------------------------------------------------------------
diff --git a/assembly/release-hadoop-lgpl.xml b/assembly/release-hadoop-lgpl.xml
deleted file mode 100644
index ac2fc31..0000000
--- a/assembly/release-hadoop-lgpl.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  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.
--->
-
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
-          http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-    <id>fabric</id>
-
-    <includeBaseDirectory>false</includeBaseDirectory>
-
-    <formats>
-        <format>dir</format>
-    </formats>
-
-    <files>
-        <file>
-            <source>assembly/LICENSE_HADOOP</source><!--assembly should contain at least one file. copied from release-hadoop.xml -->
-            <destName>LICENSE</destName>
-            <outputDirectory>/</outputDirectory>
-        </file>
-    </files>
-</assembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/config/fabric-lgpl/default-config.xml
----------------------------------------------------------------------
diff --git a/config/fabric-lgpl/default-config.xml b/config/fabric-lgpl/default-config.xml
new file mode 100644
index 0000000..5da95ba
--- /dev/null
+++ b/config/fabric-lgpl/default-config.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <!--
+        Alter configuration below as needed.
+    -->
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"/>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/README.txt
----------------------------------------------------------------------
diff --git a/examples-lgpl/README.txt b/examples-lgpl/README.txt
deleted file mode 100644
index 8c8982e..0000000
--- a/examples-lgpl/README.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-Apache Ignite LGPL Examples
-======================
-
-This folder contains code examples for various Apache Ignite functionality.
-
-Examples are shipped as a separate Maven project, so to start running you simply need
-to import provided `pom.xml` file into your favourite IDE.
-
-The examples folder contains he following subfolders:
-
-- `config` - contains Ignite configuration files needed for examples.
-- `src/main/java` - contains Java examples for different Ignite modules and features.
-- `src/main/java8` - contains additional set of Java examples utilizing Java 8 lambdas. These examples
-  are excluded by default, enable `java8-examples` Maven profile to include them (JDK8 is required).
-
-
-Starting Remote Nodes
-=====================
-
-Remote nodes for examples should always be started with special configuration file which enables P2P
-class loading: `examples/config/example-ignite.xml`. To run a remote node in IDE use `ExampleNodeStartup` class.
-
-
-Java7 vs Java8
-===============
-Some examples (not all) which can benefit from Java8 Lambda support were re-written with Java8 lambdas.
-For full set of examples, look at both Java7 and Java8 packages.

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/config/example-cache.xml
----------------------------------------------------------------------
diff --git a/examples-lgpl/config/example-cache.xml b/examples-lgpl/config/example-cache.xml
deleted file mode 100644
index dcb8e75..0000000
--- a/examples-lgpl/config/example-cache.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  ~  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.
-  -->
-
-<!--
-    Ignite Spring configuration file to startup Ignite cache.
-
-    This file demonstrates how to configure cache using Spring. Provided cache
-    will be created on node startup.
-
-    Use this configuration file when running HTTP REST examples (see 'examples/rest' folder).
-
-    When starting a standalone node, you need to execute the following command:
-    {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/example-cache.xml
-
-    When starting Ignite from Java IDE, pass path to this file to Ignition:
-    Ignition.start("examples/config/example-cache.xml");
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd">
-    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <property name="cacheConfiguration">
-            <list>
-                <!-- Partitioned cache example configuration (Atomic mode). -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="atomicityMode" value="ATOMIC"/>
-                    <property name="backups" value="1"/>
-                </bean>
-            </list>
-        </property>
-
-        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <!--
-                        Ignite provides several options for automatic discovery that can be used
-                        instead os static IP based discovery. For information on all options refer
-                        to our documentation: http://apacheignite.readme.io/docs/cluster-config
-                    -->
-                    <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
-                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47509</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/config/example-ignite.xml
----------------------------------------------------------------------
diff --git a/examples-lgpl/config/example-ignite.xml b/examples-lgpl/config/example-ignite.xml
deleted file mode 100644
index e870106..0000000
--- a/examples-lgpl/config/example-ignite.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  ~  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.
-  -->
-
-<!--
-    Ignite configuration with all defaults and enabled p2p deployment and enabled events.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <!-- Set to true to enable distributed class loading for examples, default is false. -->
-        <property name="peerClassLoadingEnabled" value="true"/>
-
-        <property name="marshaller">
-            <bean class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
-                <!-- Set to false to allow non-serializable objects in examples, default is true. -->
-                <property name="requireSerializable" value="false"/>
-            </bean>
-        </property>
-
-        <!-- Enable task execution events for examples. -->
-        <property name="includeEventTypes">
-            <list>
-                <!--Task execution events-->
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
-
-                <!--Cache events-->
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED"/>
-            </list>
-        </property>
-
-        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <!--
-                        Ignite provides several options for automatic discovery that can be used
-                        instead os static IP based discovery. For information on all options refer
-                        to our documentation: http://apacheignite.readme.io/docs/cluster-config
-                    -->
-                    <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
-                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47509</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/config/hibernate/README.txt
----------------------------------------------------------------------
diff --git a/examples-lgpl/config/hibernate/README.txt b/examples-lgpl/config/hibernate/README.txt
deleted file mode 100644
index 5b7ab29..0000000
--- a/examples-lgpl/config/hibernate/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Hibernate L2 Cache Configuration Example
-----------------------------------------
-
-This folder contains example-hibernate-L2-cache.xml file that demonstrates
-how to configure Hibernate to use Apache Ignite cache as an L2 cache provider.
-
-This file is also used in Hibernate example located in org.apache.ignite.examples.datagrid.hibernate
-package.

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/config/hibernate/example-hibernate-L2-cache.xml
----------------------------------------------------------------------
diff --git a/examples-lgpl/config/hibernate/example-hibernate-L2-cache.xml b/examples-lgpl/config/hibernate/example-hibernate-L2-cache.xml
deleted file mode 100644
index a2f7e89..0000000
--- a/examples-lgpl/config/hibernate/example-hibernate-L2-cache.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  ~  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 hibernate-configuration PUBLIC
-    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
-
-<!--
-    Configuration file for HibernateL2CacheExample.
--->
-
-<hibernate-configuration>
-    <session-factory>
-        <!-- Database connection settings -->
-        <property name="connection.url">jdbc:h2:mem:example;DB_CLOSE_DELAY=-1</property>
-
-        <!-- Drop and re-create the database schema on startup. -->
-        <property name="hbm2ddl.auto">create</property>
-
-        <!-- Enable L2 cache. -->
-        <property name="cache.use_second_level_cache">true</property>
-
-        <!-- Enable query cache. -->
-        <property name="cache.use_query_cache">true</property>
-
-        <!-- Generate L2 cache statistics. -->
-        <property name="generate_statistics">true</property>
-
-        <!-- Specify Ignite as L2 cache provider. -->
-        <property name="cache.region.factory_class">org.apache.ignite.cache.hibernate.HibernateRegionFactory</property>
-
-        <!-- Specify connection release mode. -->
-        <property name="connection.release_mode">on_close</property>
-
-        <!-- Set default L2 cache access type. -->
-        <property name="org.apache.ignite.hibernate.default_access_type">READ_ONLY</property>
-
-        <!-- Specify the entity classes for mapping. -->
-        <mapping class="org.apache.ignite.examples.datagrid.hibernate.User"/>
-        <mapping class="org.apache.ignite.examples.datagrid.hibernate.Post"/>
-
-        <!-- Per-class L2 cache settings. -->
-        <class-cache class="org.apache.ignite.examples.datagrid.hibernate.User" usage="read-only"/>
-        <class-cache class="org.apache.ignite.examples.datagrid.hibernate.Post" usage="read-only"/>
-        <collection-cache collection="org.apache.ignite.examples.datagrid.hibernate.User.posts" usage="read-only"/>
-    </session-factory>
-</hibernate-configuration>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/pom-standalone.xml
----------------------------------------------------------------------
diff --git a/examples-lgpl/pom-standalone.xml b/examples-lgpl/pom-standalone.xml
deleted file mode 100644
index 2e3bf8f..0000000
--- a/examples-lgpl/pom-standalone.xml
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  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.
--->
-
-<!--
-    POM file.
--->
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
-    <groupId>org.apache.ignite</groupId>
-    <artifactId>ignite-examples-lgpl</artifactId>
-    <version>to_be_replaced_by_ignite_version</version>
-    <packaging>pom</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.ignite</groupId>
-            <artifactId>ignite-examples</artifactId>
-            <version>to_be_replaced_by_ignite_version</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.ignite</groupId>
-            <artifactId>ignite-hibernate</artifactId>
-            <version>to_be_replaced_by_ignite_version</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.ignite</groupId>
-            <artifactId>ignite-schedule</artifactId>
-            <version>to_be_replaced_by_ignite_version</version>
-        </dependency>
-    </dependencies>
-
-    <modules>
-        <module>../examples</module>
-    </modules>
-
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-            <resource>
-                <directory>config</directory>
-            </resource>
-        </resources>
-
-        <plugins>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
-                <configuration>
-                    <source>1.7</source>
-                    <target>1.7</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-    <profiles>
-        <profile>
-            <id>java8-examples</id>
-
-            <activation>
-                <jdk>[1.8,)</jdk>
-            </activation>
-
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-compiler-plugin</artifactId>
-                        <version>3.1</version>
-                        <configuration>
-                            <source>1.8</source>
-                            <target>1.8</target>
-                        </configuration>
-                    </plugin>
-
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.9.1</version>
-                        <executions>
-                            <execution>
-                                <id>add-sources</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>add-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/main/java8</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>add-tests</id>
-                                <phase>generate-test-sources</phase>
-                                <goals>
-                                    <goal>add-test-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/test/java8</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-        <profile>
-            <id>scala</id>
-
-            <dependencies>
-                <dependency>
-                    <groupId>org.apache.ignite</groupId>
-                    <artifactId>ignite-scalar</artifactId>
-                    <version>to_be_replaced_by_ignite_version</version>
-                </dependency>
-            </dependencies>
-
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>net.alchim31.maven</groupId>
-                        <artifactId>scala-maven-plugin</artifactId>
-                        <version>3.2.0</version>
-                        <configuration>
-                            <jvmArgs>
-                                <jvmArg>-Xms512m</jvmArg>
-                                <jvmArg>-Xmx1024m</jvmArg>
-                            </jvmArgs>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <id>scala-compile-first</id>
-                                <phase>process-resources</phase>
-                                <goals>
-                                    <goal>add-source</goal>
-                                    <goal>compile</goal>
-                                </goals>
-                            </execution>
-                            <execution>
-                                <id>scala-test-compile</id>
-                                <phase>process-test-resources</phase>
-                                <goals>
-                                    <goal>testCompile</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/pom.xml
----------------------------------------------------------------------
diff --git a/examples-lgpl/pom.xml b/examples-lgpl/pom.xml
deleted file mode 100644
index 019dc23..0000000
--- a/examples-lgpl/pom.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  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.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.ignite</groupId>
-        <artifactId>ignite-parent</artifactId>
-        <version>1</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-
-    <artifactId>ignite-examples-lgpl</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.ignite</groupId>
-            <artifactId>ignite-hibernate</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.ignite</groupId>
-            <artifactId>ignite-schedule</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.ignite</groupId>
-            <artifactId>ignite-examples</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.ignite</groupId>
-            <artifactId>ignite-core</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-            <resource>
-                <directory>config</directory>
-            </resource>
-        </resources>
-    </build>
-
-    <profiles>
-        <profile>
-            <id>java8-examples</id>
-
-            <activation>
-                <jdk>[1.8,)</jdk>
-            </activation>
-
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-compiler-plugin</artifactId>
-                        <configuration>
-                            <source>1.8</source>
-                            <target>1.8</target>
-                        </configuration>
-                    </plugin>
-
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.9.1</version>
-                        <executions>
-                            <execution>
-                                <id>add-sources</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>add-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/main/java8</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>add-tests</id>
-                                <phase>generate-test-sources</phase>
-                                <goals>
-                                    <goal>add-test-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/test/java8</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
deleted file mode 100644
index 2f271c8..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.datagrid.hibernate;
-
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.examples.ExampleNodeStartup;
-import org.apache.ignite.examples.ExamplesUtils;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.cache.spi.access.AccessType;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.service.ServiceRegistryBuilder;
-import org.hibernate.stat.SecondLevelCacheStatistics;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
-
-/**
- * This example demonstrates the use of Ignite In-Memory Data Ignite cluster as a Hibernate
- * Second-Level cache provider.
- * <p>
- * The Hibernate Second-Level cache (or "L2 cache" shortly) lets you significantly
- * reduce the number of requests to the underlying SQL database. Because database
- * access is known to be an expansive operation, using L2 cache may improve
- * performance dramatically.
- * <p>
- * This example defines 2 entity classes: {@link User} and {@link Post}, with
- * 1 <-> N relation, and marks them with appropriate annotations for Hibernate
- * object-relational mapping to SQL tables of an underlying H2 in-memory database.
- * The example launches node in the same JVM and registers it in
- * Hibernate configuration as an L2 cache implementation. It then stores and
- * queries instances of the entity classes to and from the database, having
- * Hibernate SQL output, L2 cache statistics output, and Ignite cache metrics
- * output enabled.
- * <p>
- * When running example, it's easy to notice that when an object is first
- * put into a database, the L2 cache is not used and it's contents is empty.
- * However, when an object is first read from the database, it is immediately
- * stored in L2 cache (which is Ignite In-Memory Data Ignite cluster in fact), which can
- * be seen in stats output. Further requests of the same object only read the data
- * from L2 cache and do not hit the database.
- * <p>
- * In this example, the Hibernate query cache is also enabled. Query cache lets you
- * avoid hitting the database in case of repetitive queries with the same parameter
- * values. You may notice that when the example runs the same query repeatedly in
- * loop, only the first query hits the database and the successive requests take the
- * data from L2 cache.
- * <p>
- * Note: this example uses {@link AccessType#READ_ONLY} L2 cache access type, but you
- * can experiment with other access types by modifying the Hibernate configuration file
- * {@code IGNITE_HOME/examples/config/hibernate/example-hibernate-L2-cache.xml}, used by the example.
- * <p>
- * Remote nodes should always be started with special configuration file which
- * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
- * <p>
- * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will
- * start node with {@code examples/config/example-ignite.xml} configuration.
- */
-public class HibernateL2CacheExample {
-    /** JDBC URL for backing database (an H2 in-memory database is used). */
-    private static final String JDBC_URL = "jdbc:h2:mem:example;DB_CLOSE_DELAY=-1";
-
-    /** Path to hibernate configuration file (will be resolved from application {@code CLASSPATH}). */
-    private static final String HIBERNATE_CFG = "hibernate/example-hibernate-L2-cache.xml";
-
-    /** Entity names for stats output. */
-    private static final List<String> ENTITY_NAMES =
-        Arrays.asList(User.class.getName(), Post.class.getName(), User.class.getName() + ".posts");
-
-    /**
-     * Executes example.
-     *
-     * @param args Command line arguments, none required.
-     * @throws IgniteException If example execution failed.
-     */
-    public static void main(String[] args) throws IgniteException {
-        // Start the node, run the example, and stop the node when finished.
-        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
-            // We use a single session factory, but create a dedicated session
-            // for each transaction or query. This way we ensure that L1 cache
-            // is not used (L1 cache has per-session scope only).
-            System.out.println();
-            System.out.println(">>> Hibernate L2 cache example started.");
-
-            try (
-                // Create all required caches.
-                IgniteCache c1 = createCache("org.hibernate.cache.spi.UpdateTimestampsCache", ATOMIC);
-                IgniteCache c2 = createCache("org.hibernate.cache.internal.StandardQueryCache", ATOMIC);
-                IgniteCache c3 = createCache("org.apache.ignite.examples.datagrid.hibernate.User", TRANSACTIONAL);
-                IgniteCache c4 = createCache("org.apache.ignite.examples.datagrid.hibernate.User.posts", TRANSACTIONAL);
-                IgniteCache c5 = createCache("org.apache.ignite.examples.datagrid.hibernate.Post", TRANSACTIONAL)
-            ) {
-                URL hibernateCfg = ExamplesUtils.url(HIBERNATE_CFG);
-
-                SessionFactory sesFactory = createHibernateSessionFactory(hibernateCfg);
-
-                System.out.println();
-                System.out.println(">>> Creating objects.");
-
-                final long userId;
-
-                Session ses = sesFactory.openSession();
-
-                try {
-                    Transaction tx = ses.beginTransaction();
-
-                    User user = new User("jedi", "Luke", "Skywalker");
-
-                    user.getPosts().add(new Post(user, "Let the Force be with you."));
-
-                    ses.save(user);
-
-                    tx.commit();
-
-                    // Create a user object, store it in DB, and save the database-generated
-                    // object ID. You may try adding more objects in a similar way.
-                    userId = user.getId();
-                }
-                finally {
-                    ses.close();
-                }
-
-                // Output L2 cache and Ignite cache stats. You may notice that
-                // at this point the object is not yet stored in L2 cache, because
-                // the read was not yet performed.
-                printStats(sesFactory);
-
-                System.out.println();
-                System.out.println(">>> Querying object by ID.");
-
-                // Query user by ID several times. First time we get an L2 cache
-                // miss, and the data is queried from DB, but it is then stored
-                // in cache and successive queries hit the cache and return
-                // immediately, no SQL query is made.
-                for (int i = 0; i < 3; i++) {
-                    ses = sesFactory.openSession();
-
-                    try {
-                        Transaction tx = ses.beginTransaction();
-
-                        User user = (User)ses.get(User.class, userId);
-
-                        System.out.println("User: " + user);
-
-                        for (Post post : user.getPosts())
-                            System.out.println("\tPost: " + post);
-
-                        tx.commit();
-                    }
-                    finally {
-                        ses.close();
-                    }
-                }
-
-                // Output the stats. We should see 1 miss and 2 hits for
-                // User and Collection object (stored separately in L2 cache).
-                // The Post is loaded with the collection, so it won't imply
-                // a miss.
-                printStats(sesFactory);
-            }
-        }
-    }
-
-    /**
-     * Creates cache.
-     *
-     * @param name Cache name.
-     * @param atomicityMode Atomicity mode.
-     * @return Cache configuration.
-     */
-    private static IgniteCache createCache(String name, CacheAtomicityMode atomicityMode) {
-        CacheConfiguration ccfg = new CacheConfiguration(name);
-
-        ccfg.setAtomicityMode(atomicityMode);
-        ccfg.setWriteSynchronizationMode(FULL_SYNC);
-
-        return Ignition.ignite().getOrCreateCache(ccfg);
-    }
-
-    /**
-     * Creates a new Hibernate {@link SessionFactory} using a programmatic
-     * configuration.
-     *
-     * @param hibernateCfg Hibernate configuration file.
-     * @return New Hibernate {@link SessionFactory}.
-     */
-    private static SessionFactory createHibernateSessionFactory(URL hibernateCfg) {
-        ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
-
-        builder.applySetting("hibernate.connection.url", JDBC_URL);
-        builder.applySetting("hibernate.show_sql", true);
-
-        return new Configuration()
-            .configure(hibernateCfg)
-            .buildSessionFactory(builder.buildServiceRegistry());
-    }
-
-    /**
-     * Prints Hibernate L2 cache statistics to standard output.
-     *
-     * @param sesFactory Hibernate {@link SessionFactory}, for which to print
-     *                   statistics.
-     */
-    private static void printStats(SessionFactory sesFactory) {
-        System.out.println("=== Hibernate L2 cache statistics ===");
-
-        for (String entityName : ENTITY_NAMES) {
-            System.out.println("\tEntity: " + entityName);
-
-            SecondLevelCacheStatistics stats =
-                sesFactory.getStatistics().getSecondLevelCacheStatistics(entityName);
-
-            System.out.println("\t\tL2 cache entries: " + stats.getEntries());
-            System.out.println("\t\tHits: " + stats.getHitCount());
-            System.out.println("\t\tMisses: " + stats.getMissCount());
-        }
-
-        System.out.println("=====================================");
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/Post.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/Post.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/Post.java
deleted file mode 100644
index 8e98835..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/Post.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.datagrid.hibernate;
-
-import java.util.Date;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-
-/**
- * An entity class representing a post, that a
- * {@link User} has made on some public service.
- */
-@Entity
-class Post {
-    /** ID. */
-    @Id
-    @GeneratedValue(strategy=GenerationType.AUTO)
-    private long id;
-
-    /** Author. */
-    @ManyToOne
-    private User author;
-
-    /** Text. */
-    private String text;
-
-    /** Created timestamp. */
-    private Date created;
-
-    /**
-     * Default constructor (required by Hibernate).
-     */
-    Post() {
-        // No-op.
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param author Author.
-     * @param text Text.
-     */
-    Post(User author, String text) {
-        this.author = author;
-        this.text = text;
-        created = new Date();
-    }
-
-    /**
-     * @return ID.
-     */
-    public long getId() {
-        return id;
-    }
-
-    /**
-     * @param id New ID.
-     */
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    /**
-     * @return Author.
-     */
-    public User getAuthor() {
-        return author;
-    }
-
-    /**
-     * @param author New author.
-     */
-    public void setAuthor(User author) {
-        this.author = author;
-    }
-
-    /**
-     * @return Text.
-     */
-    public String getText() {
-        return text;
-    }
-
-    /**
-     * @param text New text.
-     */
-    public void setText(String text) {
-        this.text = text;
-    }
-
-    /**
-     * @return Created timestamp.
-     */
-    public Date getCreated() {
-        return (Date)created.clone();
-    }
-
-    /**
-     * @param created New created timestamp.
-     */
-    public void setCreated(Date created) {
-        this.created = (Date)created.clone();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return "Post [id=" + id +
-            ", text=" + text +
-            ", created=" + created +
-            ']';
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/User.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/User.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/User.java
deleted file mode 100644
index d0486f5..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/User.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.datagrid.hibernate;
-
-import java.util.HashSet;
-import java.util.Set;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import org.hibernate.annotations.NaturalId;
-
-/**
- * A user entity class. Represents a user of some public service,
- * having a number of personal information fields as well as a
- * number of posts written.
- */
-@Entity
-class User {
-    /** ID. */
-    @Id
-    @GeneratedValue(strategy=GenerationType.AUTO)
-    private long id;
-
-    /** Login. */
-    @NaturalId
-    private String login;
-
-    /** First name. */
-    private String firstName;
-
-    /** Last name. */
-    private String lastName;
-
-    /** Posts. */
-    @OneToMany(mappedBy = "author", cascade = CascadeType.ALL)
-    private Set<Post> posts = new HashSet<>();
-
-    /**
-     * Default constructor (required by Hibernate).
-     */
-    User() {
-        // No-op.
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param login Login.
-     * @param firstName First name.
-     * @param lastName Last name.
-     */
-    User(String login, String firstName, String lastName) {
-        this.login = login;
-        this.firstName = firstName;
-        this.lastName = lastName;
-    }
-
-    /**
-     * @return ID.
-     */
-    public long getId() {
-        return id;
-    }
-
-    /**
-     * @param id New ID.
-     */
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    /**
-     * @return Login.
-     */
-    public String getLogin() {
-        return login;
-    }
-
-    /**
-     * @param login New login.
-     */
-    public void setLogin(String login) {
-        this.login = login;
-    }
-
-    /**
-     * @return First name.
-     */
-    public String getFirstName() {
-        return firstName;
-    }
-
-    /**
-     * @param firstName New first name.
-     */
-    public void setFirstName(String firstName) {
-        this.firstName = firstName;
-    }
-
-    /**
-     * @return Last name.
-     */
-    public String getLastName() {
-        return lastName;
-    }
-
-    /**
-     * @param lastName New last name.
-     */
-    public void setLastName(String lastName) {
-        this.lastName = lastName;
-    }
-
-    /**
-     * @return Posts.
-     */
-    public Set<Post> getPosts() {
-        return posts;
-    }
-
-    /**
-     * @param posts New posts.
-     */
-    public void setPosts(Set<Post> posts) {
-        this.posts = posts;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return "User [id=" + id +
-            ", login=" + login +
-            ", firstName=" + firstName +
-            ", lastName=" + lastName +
-            ']';
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/package-info.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/package-info.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/package-info.java
deleted file mode 100644
index 7bddaaf..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/hibernate/package-info.java
+++ /dev/null
@@ -1,22 +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 description. -->
- * Hibernate example.
- */
-package org.apache.ignite.examples.datagrid.hibernate;

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernatePersonStore.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernatePersonStore.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernatePersonStore.java
deleted file mode 100644
index d040b88..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernatePersonStore.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.datagrid.store.hibernate;
-
-import java.util.List;
-import java.util.UUID;
-import javax.cache.integration.CacheLoaderException;
-import javax.cache.integration.CacheWriterException;
-import org.apache.ignite.cache.store.CacheStore;
-import org.apache.ignite.cache.store.CacheStoreAdapter;
-import org.apache.ignite.cache.store.CacheStoreSession;
-import org.apache.ignite.examples.datagrid.store.Person;
-import org.apache.ignite.lang.IgniteBiInClosure;
-import org.apache.ignite.resources.CacheStoreSessionResource;
-import org.hibernate.HibernateException;
-import org.hibernate.Session;
-
-/**
- * Example of {@link CacheStore} implementation that uses Hibernate
- * and deals with maps {@link UUID} to {@link Person}.
- */
-public class CacheHibernatePersonStore extends CacheStoreAdapter<Long, Person> {
-    /** Auto-injected store session. */
-    @CacheStoreSessionResource
-    private CacheStoreSession ses;
-
-    /** {@inheritDoc} */
-    @Override public Person load(Long key) {
-        System.out.println(">>> Store load [key=" + key + ']');
-
-        Session hibSes = ses.attachment();
-
-        try {
-            return (Person)hibSes.get(Person.class, key);
-        }
-        catch (HibernateException e) {
-            throw new CacheLoaderException("Failed to load value from cache store [key=" + key + ']', e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void write(javax.cache.Cache.Entry<? extends Long, ? extends Person> entry) {
-        Long key = entry.getKey();
-        Person val = entry.getValue();
-
-        System.out.println(">>> Store write [key=" + key + ", val=" + val + ']');
-
-        Session hibSes = ses.attachment();
-
-        try {
-            hibSes.saveOrUpdate(val);
-        }
-        catch (HibernateException e) {
-            throw new CacheWriterException("Failed to put value to cache store [key=" + key + ", val" + val + "]", e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"JpaQueryApiInspection"})
-    @Override public void delete(Object key) {
-        System.out.println(">>> Store delete [key=" + key + ']');
-
-        Session hibSes = ses.attachment();
-
-        try {
-            hibSes.createQuery("delete " + Person.class.getSimpleName() + " where key = :key").
-                setParameter("key", key).
-                executeUpdate();
-        }
-        catch (HibernateException e) {
-            throw new CacheWriterException("Failed to remove value from cache store [key=" + key + ']', e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void loadCache(IgniteBiInClosure<Long, Person> clo, Object... args) {
-        if (args == null || args.length == 0 || args[0] == null)
-            throw new CacheLoaderException("Expected entry count parameter is not provided.");
-
-        final int entryCnt = (Integer)args[0];
-
-        Session hibSes = ses.attachment();
-
-        try {
-            int cnt = 0;
-
-            List list = hibSes.createCriteria(Person.class).
-                setMaxResults(entryCnt).
-                list();
-
-            if (list != null) {
-                for (Object obj : list) {
-                    Person person = (Person)obj;
-
-                    clo.apply(person.getId(), person);
-
-                    cnt++;
-                }
-            }
-
-            System.out.println(">>> Loaded " + cnt + " values into cache.");
-        }
-        catch (HibernateException e) {
-            throw new CacheLoaderException("Failed to load values from cache store.", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
----------------------------------------------------------------------
diff --git a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java b/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
deleted file mode 100644
index f993d81..0000000
--- a/examples-lgpl/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.datagrid.store.hibernate;
-
-import java.util.UUID;
-import javax.cache.configuration.Factory;
-import javax.cache.configuration.FactoryBuilder;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.cache.store.CacheStoreSessionListener;
-import org.apache.ignite.cache.store.hibernate.CacheHibernateStoreSessionListener;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.examples.ExampleNodeStartup;
-import org.apache.ignite.examples.ExamplesUtils;
-import org.apache.ignite.examples.datagrid.store.Person;
-import org.apache.ignite.transactions.Transaction;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-
-/**
- * Demonstrates usage of cache with underlying persistent store configured.
- * <p>
- * This example uses {@link CacheHibernatePersonStore} as a persistent store.
- * <p>
- * Remote nodes can be started with {@link ExampleNodeStartup} in another JVM which will
- * start node with {@code examples/config/example-ignite.xml} configuration.
- */
-public class CacheHibernateStoreExample {
-    /** Hibernate configuration resource path. */
-    private static final String HIBERNATE_CFG =
-        "/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml";
-
-    /** Cache name. */
-    private static final String CACHE_NAME = CacheHibernateStoreExample.class.getSimpleName();
-
-    /** Heap size required to run this example. */
-    public static final int MIN_MEMORY = 1024 * 1024 * 1024;
-
-    /** Number of entries to load. */
-    private static final int ENTRY_COUNT = 100_000;
-
-    /** Global person ID to use across entire example. */
-    private static final Long id = Math.abs(UUID.randomUUID().getLeastSignificantBits());
-
-    /**
-     * Executes example.
-     *
-     * @param args Command line arguments, none required.
-     * @throws IgniteException If example execution failed.
-     */
-    public static void main(String[] args) throws IgniteException {
-        ExamplesUtils.checkMinMemory(MIN_MEMORY);
-
-        // To start ignite with desired configuration uncomment the appropriate line.
-        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
-            System.out.println();
-            System.out.println(">>> Cache store example started.");
-
-            CacheConfiguration<Long, Person> cacheCfg = new CacheConfiguration<>(CACHE_NAME);
-
-            // Set atomicity as transaction, since we are showing transactions in example.
-            cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-            // Configure Hibernate store.
-            cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheHibernatePersonStore.class));
-
-            // Configure Hibernate session listener.
-            cacheCfg.setCacheStoreSessionListenerFactories(new Factory<CacheStoreSessionListener>() {
-                @Override public CacheStoreSessionListener create() {
-                    CacheHibernateStoreSessionListener lsnr = new CacheHibernateStoreSessionListener();
-
-                    lsnr.setHibernateConfigurationPath(HIBERNATE_CFG);
-
-                    return lsnr;
-                }
-            });
-
-            cacheCfg.setReadThrough(true);
-            cacheCfg.setWriteThrough(true);
-
-            try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg)) {
-                // Make initial cache loading from persistent store. This is a
-                // distributed operation and will call CacheStore.loadCache(...)
-                // method on all nodes in topology.
-                loadCache(cache);
-
-                // Start transaction and execute several cache operations with
-                // read/write-through to persistent store.
-                executeTransaction(cache);
-            }
-        }
-    }
-
-    /**
-     * Makes initial cache loading.
-     *
-     * @param cache Cache to load.
-     */
-    private static void loadCache(IgniteCache<Long, Person> cache) {
-        long start = System.currentTimeMillis();
-
-        // Start loading cache from persistent store on all caching nodes.
-        cache.loadCache(null, ENTRY_COUNT);
-
-        long end = System.currentTimeMillis();
-
-        System.out.println(">>> Loaded " + cache.size() + " keys with backups in " + (end - start) + "ms.");
-    }
-
-    /**
-     * Executes transaction with read/write-through to persistent store.
-     *
-     * @param cache Cache to execute transaction on.
-     */
-    private static void executeTransaction(IgniteCache<Long, Person> cache) {
-        try (Transaction tx = Ignition.ignite().transactions().txStart()) {
-            Person val = cache.get(id);
-
-            System.out.println("Read value: " + val);
-
-            val = cache.getAndPut(id, new Person(id, "Isaac", "Newton"));
-
-            System.out.println("Overwrote old value: " + val);
-
-            val = cache.get(id);
-
-            System.out.println("Read value: " + val);
-
-            tx.commit();
-        }
-
-        System.out.println("Read value after commit: " + cache.get(id));
-    }
-}


[09/16] ignite git commit: ignite-1787 Added synchronization in CacheConfiguration for cache entry listeners collection

Posted by dm...@apache.org.
ignite-1787 Added synchronization in CacheConfiguration for  cache entry listeners collection


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

Branch: refs/heads/ignite-801
Commit: 18fb46e2bdb5c75dae0d567f1db68bd593aa0355
Parents: 1334e77
Author: sboikov <sb...@gridgain.com>
Authored: Tue Oct 27 12:21:46 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Oct 27 12:21:46 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       | 28 ++++++++++-
 .../IgniteCacheEntryListenerAbstractTest.java   | 50 +++++++++++++++++++-
 2 files changed, 76 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/18fb46e2/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 6ac2b64..374743f 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -21,6 +21,7 @@ import java.io.Serializable;
 import java.util.Collection;
 import java.util.HashSet;
 import javax.cache.Cache;
+import javax.cache.configuration.CacheEntryListenerConfiguration;
 import javax.cache.configuration.CompleteConfiguration;
 import javax.cache.configuration.Factory;
 import javax.cache.configuration.MutableConfiguration;
@@ -336,7 +337,9 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
         /* No-op. */
     }
 
-    /** Cache name. */
+    /**
+     * @param name Cache name.
+     */
     public CacheConfiguration(String name) {
         this.name = name;
     }
@@ -1800,6 +1803,29 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
         return this;
     }
 
+    /** {@inheritDoc} */
+    @Override public Iterable<CacheEntryListenerConfiguration<K, V>> getCacheEntryListenerConfigurations() {
+        synchronized (this) {
+            return new HashSet<>(listenerConfigurations);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public MutableConfiguration<K, V> addCacheEntryListenerConfiguration(
+        CacheEntryListenerConfiguration<K, V> cacheEntryLsnrCfg) {
+        synchronized (this) {
+            return super.addCacheEntryListenerConfiguration(cacheEntryLsnrCfg);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public MutableConfiguration<K, V> removeCacheEntryListenerConfiguration(
+        CacheEntryListenerConfiguration<K, V> cacheEntryLsnrCfg) {
+        synchronized (this) {
+            return super.removeCacheEntryListenerConfiguration(cacheEntryLsnrCfg);
+        }
+    }
+
     /**
      * Creates a copy of current configuration and removes all cache entry listeners.
      * They are executed only locally and should never be sent to remote nodes.

http://git-wip-us.apache.org/repos/asf/ignite/blob/18fb46e2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java
index 3fdd7fc..8a3d756 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java
@@ -33,6 +33,7 @@ import java.util.Set;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.atomic.AtomicBoolean;
 import javax.cache.configuration.CacheEntryListenerConfiguration;
 import javax.cache.configuration.Factory;
@@ -366,6 +367,42 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
     /**
      * @throws Exception If failed.
      */
+    public void testConcurrentRegisterDeregister() throws Exception {
+        final int THREADS = 10;
+
+        final CyclicBarrier barrier = new CyclicBarrier(THREADS);
+
+        final IgniteCache<Integer, Integer> cache = jcache(0);
+
+        GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
+            @Override public Void call() throws Exception {
+                CacheEntryListenerConfiguration<Integer, Integer> cfg = new MutableCacheEntryListenerConfiguration<>(
+                    new Factory<CacheEntryListener<Integer, Integer>>() {
+                        @Override public CacheEntryListener<Integer, Integer> create() {
+                            return new CreateUpdateRemoveExpireListener();
+                        }
+                    },
+                    null,
+                    true,
+                    false
+                );
+
+                barrier.await();
+
+                for (int i = 0; i < 200; i++) {
+                    cache.registerCacheEntryListener(cfg);
+
+                    cache.deregisterCacheEntryListener(cfg);
+                }
+
+                return null;
+            }
+        }, THREADS, "register-thread").get();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testSerialization() throws Exception {
         if (cacheMode() == LOCAL)
             return;
@@ -951,6 +988,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class CreateUpdateRemoveExpireListenerFactory implements Factory<CacheEntryListener<Integer, Integer>> {
+        /** {@inheritDoc} */
         @Override public CacheEntryListener<Integer, Integer> create() {
             return new CreateUpdateRemoveExpireListener();
         }
@@ -960,6 +998,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class NoOpCreateUpdateListenerFactory implements Factory<CacheEntryListener<Integer, Integer>> {
+        /** {@inheritDoc} */
         @Override public CacheEntryListener<Integer, Integer> create() {
             return new NoOpCreateUpdateListener();
         }
@@ -969,6 +1008,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class CreateUpdateListenerFactory implements Factory<CacheEntryListener<Integer, Integer>> {
+        /** {@inheritDoc} */
         @Override public CacheEntryListener<Integer, Integer> create() {
             return new CreateUpdateListener();
         }
@@ -978,6 +1018,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class CreateListenerFactory implements Factory<CacheEntryListener<Integer, Integer>> {
+        /** {@inheritDoc} */
         @Override public CacheEntryListener<Integer, Integer> create() {
             return new CreateListener();
         }
@@ -987,6 +1028,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class RemoveListenerFactory implements Factory<CacheEntryListener<Integer, Integer>> {
+        /** {@inheritDoc} */
         @Override public CacheEntryListener<Integer, Integer> create() {
             return new RemoveListener();
         }
@@ -996,6 +1038,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class UpdateListenerFactory implements Factory<CacheEntryListener<Integer, Integer>> {
+        /** {@inheritDoc} */
         @Override public CacheEntryListener<Integer, Integer> create() {
             return new UpdateListener();
         }
@@ -1005,6 +1048,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class ExpireListenerFactory implements Factory<CacheEntryListener<Integer, Integer>> {
+        /** {@inheritDoc} */
         @Override public CacheEntryListener<Integer, Integer> create() {
             return new ExpireListener();
         }
@@ -1024,6 +1068,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class CreateListener implements CacheEntryCreatedListener<Integer, Integer> {
+        /** {@inheritDoc} */
         @Override public void onCreated(Iterable<CacheEntryEvent<? extends Integer, ? extends Integer>> evts) {
             for (CacheEntryEvent<? extends Integer, ? extends Integer> evt : evts)
                 onEvent(evt);
@@ -1034,6 +1079,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class UpdateListener implements CacheEntryUpdatedListener<Integer, Integer> {
+        /** {@inheritDoc} */
         @Override public void onUpdated(Iterable<CacheEntryEvent<? extends Integer, ? extends Integer>> evts) {
             for (CacheEntryEvent<? extends Integer, ? extends Integer> evt : evts)
                 onEvent(evt);
@@ -1044,6 +1090,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class RemoveListener implements CacheEntryRemovedListener<Integer, Integer> {
+        /** {@inheritDoc} */
         @Override public void onRemoved(Iterable<CacheEntryEvent<? extends Integer, ? extends Integer>> evts) {
             for (CacheEntryEvent<? extends Integer, ? extends Integer> evt : evts)
                 onEvent(evt);
@@ -1054,6 +1101,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
      *
      */
     private static class ExpireListener implements CacheEntryExpiredListener<Integer, Integer> {
+        /** {@inheritDoc} */
         @Override public void onExpired(Iterable<CacheEntryEvent<? extends Integer, ? extends Integer>> evts) {
             for (CacheEntryEvent<? extends Integer, ? extends Integer> evt : evts)
                 onEvent(evt);
@@ -1238,7 +1286,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
         }
 
         /** {@inheritDoc} */
-        @Override public void onCreated(Iterable<CacheEntryEvent<? extends Object, ? extends Object>> evts)
+        @Override public void onCreated(Iterable<CacheEntryEvent<?, ?>> evts)
             throws CacheEntryListenerException {
             // No-op.
         }


[02/16] ignite git commit: Added --keysPerThread parameter for putAll benchmark.

Posted by dm...@apache.org.
Added --keysPerThread parameter for putAll benchmark.


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

Branch: refs/heads/ignite-801
Commit: 15cc1bdb0b35175b79487481966ad9e180927d84
Parents: e6e475c
Author: sboikov <sb...@gridgain.com>
Authored: Mon Oct 26 14:11:55 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Oct 26 14:11:55 2015 +0300

----------------------------------------------------------------------
 .../yardstick/IgniteBenchmarkArguments.java     | 11 ++++
 .../cache/IgniteCacheAbstractBenchmark.java     | 63 ++++++++++++++++++++
 .../cache/IgnitePutAllTxBenchmark.java          |  6 +-
 3 files changed, 78 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/15cc1bdb/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
index 6e9059d..792d366 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
@@ -112,6 +112,10 @@ public class IgniteBenchmarkArguments {
     @Parameter(names = {"-jdbc", "--jdbcUrl"}, description = "JDBC url")
     private String jdbcUrl;
 
+    /** */
+    @Parameter(names = {"-kpt", "--keysPerThread"}, description = "Use not intersecting keys in putAll benchmark")
+    private boolean keysPerThread;
+
     /**
      * @return JDBC url.
      */
@@ -274,6 +278,13 @@ public class IgniteBenchmarkArguments {
             (orderMode == null ? "" : "-wom=" + orderMode) + "-txc=" + txConcurrency;
     }
 
+    /**
+     * @return {@code True} if use not intersecting keys in putAll benchmark.
+     */
+    public boolean keysPerThread() {
+       return keysPerThread;
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return GridToStringBuilder.toString(IgniteBenchmarkArguments.class, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/15cc1bdb/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteCacheAbstractBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteCacheAbstractBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteCacheAbstractBenchmark.java
index 7b350c3..1260f9c 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteCacheAbstractBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteCacheAbstractBenchmark.java
@@ -17,9 +17,12 @@
 
 package org.apache.ignite.yardstick.cache;
 
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
 import org.yardstickframework.BenchmarkConfiguration;
+import org.yardstickframework.BenchmarkUtils;
 
 /**
  * Abstract class for Ignite benchmarks which use cache.
@@ -28,6 +31,12 @@ public abstract class IgniteCacheAbstractBenchmark extends IgniteAbstractBenchma
     /** Cache. */
     protected IgniteCache<Integer, Object> cache;
 
+    /** */
+    private ThreadLocal<ThreadRange> threadRange = new ThreadLocal<>();
+
+    /** */
+    private AtomicInteger threadIdx = new AtomicInteger();
+
     /** {@inheritDoc} */
     @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
         super.setUp(cfg);
@@ -36,9 +45,63 @@ public abstract class IgniteCacheAbstractBenchmark extends IgniteAbstractBenchma
     }
 
     /**
+     * @return Range.
+     */
+    protected final ThreadRange threadRange() {
+        ThreadRange r = threadRange.get();
+
+        if (r == null) {
+            if (args.keysPerThread()) {
+                int idx = threadIdx.getAndIncrement();
+
+                int keysPerThread = (int)(args.range() / (float)cfg.threads());
+
+                int min = keysPerThread * idx;
+                int max = min + keysPerThread;
+
+                r = new ThreadRange(min, max);
+            }
+            else
+                r = new ThreadRange(0, args.range());
+
+            BenchmarkUtils.println(cfg, "Initialized thread range [min=" + r.min + ", max=" + r.max + ']');
+
+            threadRange.set(r);
+        }
+
+        return r;
+    }
+
+    /**
      * Each benchmark must determine which cache will be used.
      *
      * @return IgniteCache Cache to use.
      */
     protected abstract IgniteCache<Integer, Object> cache();
+
+    /**
+     *
+     */
+    static class ThreadRange {
+        /** */
+        final int min;
+        /** */
+        final int max;
+
+        /**
+         * @param min Min.
+         * @param max Max.
+         */
+        private ThreadRange(int min, int max) {
+            this.min = min;
+            this.max = max;
+        }
+
+        /**
+         * @return Next random key.
+         */
+        int nextRandom() {
+            return ThreadLocalRandom.current().nextInt(min, max);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/15cc1bdb/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutAllTxBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutAllTxBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutAllTxBenchmark.java
index dc8e3f8..32d5b02 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutAllTxBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutAllTxBenchmark.java
@@ -41,12 +41,14 @@ public class IgnitePutAllTxBenchmark extends IgniteCacheAbstractBenchmark {
 
     /** {@inheritDoc} */
     @Override public boolean test(Map<Object, Object> ctx) throws Exception {
+        ThreadRange r = threadRange();
+
         SortedMap<Integer, Integer> vals = new TreeMap<>();
 
-        ClusterNode node = args.collocated() ? aff.mapKeyToNode(nextRandom(args.range())) : null;
+        ClusterNode node = args.collocated() ? aff.mapKeyToNode(r.nextRandom()) : null;
 
         for (int i = 0; i < args.batch(); ) {
-            int key = nextRandom(args.range());
+            int key = r.nextRandom();
 
             if (args.collocated() && !aff.isPrimary(node, key))
                 continue;


[13/16] ignite git commit: ignite-1526: IBM JDK is not fully supported by the platfrom. Additional hot fixes.

Posted by dm...@apache.org.
ignite-1526: IBM JDK is not fully supported by the platfrom. Additional hot fixes.


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

Branch: refs/heads/ignite-801
Commit: e9aa4d101506a6d9bc93dc9133c1d1c5aac0996f
Parents: df931bd
Author: Andrey Gura <ag...@gridgain.com>
Authored: Tue Oct 27 12:52:06 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Oct 27 12:52:06 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/IgniteSystemProperties.java   |  9 ++++
 .../apache/ignite/internal/IgniteKernal.java    |  2 +
 .../ignite/internal/IgniteNodeAttributes.java   |  3 ++
 .../ignite/internal/util/lang/GridFunc.java     |  8 ++-
 .../optimized/OptimizedMarshaller.java          | 10 +++-
 .../optimized/OptimizedMarshallerUtils.java     | 35 ++++++++++---
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 52 ++++++++++++++++++++
 .../GridDiscoveryManagerAttributesSelfTest.java | 44 +++++++++++++++--
 .../ignite/testframework/GridTestUtils.java     | 19 ++++++-
 9 files changed, 165 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 5d3b08b..1e7d002 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -17,9 +17,11 @@
 
 package org.apache.ignite;
 
+import java.io.Serializable;
 import java.lang.management.RuntimeMXBean;
 import java.util.Properties;
 import javax.net.ssl.HostnameVerifier;
+import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -363,6 +365,13 @@ public final class IgniteSystemProperties {
     public static final String IGNITE_JDBC_DRIVER_CURSOR_REMOVE_DELAY = "IGNITE_JDBC_DRIVER_CURSOR_RMV_DELAY";
 
     /**
+     * Manages {@link OptimizedMarshaller} behavior of {@code serialVersionUID} computation for
+     * {@link Serializable} classes.
+     * */
+    public static final String IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID =
+        "IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID";
+
+    /**
      * Enforces singleton.
      */
     private IgniteSystemProperties() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/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 c02dc59..0865119 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
@@ -200,6 +200,7 @@ import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_JVM_PID;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_LANG_RUNTIME;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MARSHALLER;
+import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MARSHALLER_USE_DFLT_SUID;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_NODE_CONSISTENT_ID;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PEER_CLASSLOADING;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PHY_RAM;
@@ -1267,6 +1268,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
         add(ATTR_BUILD_VER, VER_STR);
         add(ATTR_BUILD_DATE, BUILD_TSTAMP_STR);
         add(ATTR_MARSHALLER, cfg.getMarshaller().getClass().getName());
+        add(ATTR_MARSHALLER_USE_DFLT_SUID, OptimizedMarshaller.USE_DFLT_SUID);
         add(ATTR_USER_NAME, System.getProperty("user.name"));
         add(ATTR_GRID_NAME, gridName);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
index 10b8df0..b7d2910 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
@@ -34,6 +34,9 @@ public final class IgniteNodeAttributes {
     public static final String ATTR_MARSHALLER = ATTR_PREFIX + ".marshaller";
 
     /** Internal attribute name constant. */
+    public static final String ATTR_MARSHALLER_USE_DFLT_SUID = ATTR_PREFIX + ".marshaller.useDefaultSUID";
+
+    /** Internal attribute name constant. */
     public static final String ATTR_JIT_NAME = ATTR_PREFIX + ".jit.name";
 
     /** Internal attribute name constant. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index 43bc5f3..c1d91a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -117,6 +117,9 @@ public class GridFunc {
 
     /** */
     private static final IgnitePredicate<Object> ALWAYS_TRUE = new P1<Object>() {
+        /** */
+        private static final long serialVersionUID = 6101914246981105862L;
+
         @Override public boolean apply(Object e) {
             return true;
         }
@@ -1221,9 +1224,10 @@ public class GridFunc {
         if (isEmpty(nodeIds))
             return alwaysFalse();
 
-        assert nodeIds != null;
-
         return new P1<T>() {
+            /** */
+            private static final long serialVersionUID = -5664060422647374863L;
+
             @Override public boolean apply(ClusterNode e) {
                 return nodeIds.contains(e.id());
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java
index caccd99..b2c98b2 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java
@@ -25,6 +25,7 @@ import java.io.Serializable;
 import java.util.concurrent.ConcurrentMap;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.internal.util.GridUnsafe;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.marshaller.AbstractMarshaller;
@@ -32,8 +33,11 @@ import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 import sun.misc.Unsafe;
 
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID;
+
 /**
- * Optimized implementation of {@link org.apache.ignite.marshaller.Marshaller}. Unlike {@link org.apache.ignite.marshaller.jdk.JdkMarshaller},
+ * Optimized implementation of {@link org.apache.ignite.marshaller.Marshaller}.
+ * Unlike {@link org.apache.ignite.marshaller.jdk.JdkMarshaller},
  * which is based on standard {@link ObjectOutputStream}, this marshaller does not
  * enforce that all serialized objects implement {@link Serializable} interface. It is also
  * about 20 times faster as it removes lots of serialization overhead that exists in
@@ -80,6 +84,10 @@ import sun.misc.Unsafe;
  * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
  */
 public class OptimizedMarshaller extends AbstractMarshaller {
+    /** Use default {@code serialVersionUID} for {@link Serializable} classes. */
+    public static final boolean USE_DFLT_SUID =
+        IgniteSystemProperties.getBoolean(IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID, false);
+
     /** Default class loader. */
     private final ClassLoader dfltClsLdr = getClass().getClassLoader();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
index 584083c..4d6afe6 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.ObjectStreamClass;
 import java.io.Serializable;
 import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.nio.charset.Charset;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -42,10 +43,6 @@ class OptimizedMarshallerUtils {
     /** */
     private static final Unsafe UNSAFE = GridUnsafe.unsafe();
 
-    /** Use default {@code serialVersionUid} for {@link Serializable} classes. */
-    private static final boolean USE_DFLT_SUID =
-        Boolean.valueOf(System.getProperty("ignite.marsh.optimized.useDefaultSUID", Boolean.TRUE.toString()));
-
     /** */
     static final long HASH_SET_MAP_OFF;
 
@@ -277,8 +274,8 @@ class OptimizedMarshallerUtils {
     }
 
     /**
-     * Computes the serial version UID value for the given class.
-     * The code is taken from {@link ObjectStreamClass#computeDefaultSUID(Class)}.
+     * Computes the serial version UID value for the given class. The code is taken from {@link
+     * ObjectStreamClass#computeDefaultSUID(Class)}.
      *
      * @param cls A class.
      * @param fields Fields.
@@ -287,8 +284,30 @@ class OptimizedMarshallerUtils {
      */
     @SuppressWarnings("ForLoopReplaceableByForEach")
     static short computeSerialVersionUid(Class cls, List<Field> fields) throws IOException {
-        if (USE_DFLT_SUID && Serializable.class.isAssignableFrom(cls) && !Enum.class.isAssignableFrom(cls))
-            return (short)ObjectStreamClass.lookup(cls).getSerialVersionUID();
+        if (Serializable.class.isAssignableFrom(cls) && !Enum.class.isAssignableFrom(cls)) {
+            try {
+                Field field = cls.getDeclaredField("serialVersionUID");
+
+                if (field.getType() == long.class) {
+                    int mod = field.getModifiers();
+
+                    if (Modifier.isStatic(mod) && Modifier.isFinal(mod)) {
+                        field.setAccessible(true);
+
+                        return (short)field.getLong(null);
+                    }
+                }
+            }
+            catch (NoSuchFieldException e) {
+                // No-op.
+            }
+            catch (IllegalAccessException e) {
+                throw new IOException(e);
+            }
+
+            if (OptimizedMarshaller.USE_DFLT_SUID)
+                return (short)ObjectStreamClass.lookup(cls).getSerialVersionUID();
+        }
 
         MessageDigest md;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index d8ee953..b8df846 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -126,12 +126,14 @@ import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryStatusCheckMessa
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID;
 import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
 import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
 import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
 import static org.apache.ignite.events.EventType.EVT_NODE_METRICS_UPDATED;
 import static org.apache.ignite.events.EventType.EVT_NODE_SEGMENTED;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MARSHALLER;
+import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MARSHALLER_USE_DFLT_SUID;
 import static org.apache.ignite.spi.IgnitePortProtocol.TCP;
 import static org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoverySpiState.AUTH_FAILED;
 import static org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoverySpiState.CHECK_FAILED;
@@ -2988,6 +2990,56 @@ class ServerImpl extends TcpDiscoveryImpl {
                     return;
                 }
 
+                // If node have no value for this attribute then we treat it as true.
+                Boolean locMarshUseDfltSuid = locNode.attribute(ATTR_MARSHALLER_USE_DFLT_SUID);
+                boolean locMarshUseDfltSuidBool = locMarshUseDfltSuid == null ? true : locMarshUseDfltSuid;
+
+                Boolean rmtMarshUseDfltSuid = node.attribute(ATTR_MARSHALLER_USE_DFLT_SUID);
+                boolean rmtMarshUseDfltSuidBool = rmtMarshUseDfltSuid == null ? true : rmtMarshUseDfltSuid;
+
+                if (locMarshUseDfltSuidBool != rmtMarshUseDfltSuidBool) {
+                    String errMsg = "Local node's " + IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID +
+                        " property value differs from remote node's value " +
+                        "(to make sure all nodes in topology have identical marshaller settings, " +
+                        "configure system property explicitly) " +
+                        "[locMarshUseDfltSuid=" + locMarshUseDfltSuid + ", rmtMarshUseDfltSuid=" + rmtMarshUseDfltSuid +
+                        ", locNodeAddrs=" + U.addressesAsString(locNode) +
+                        ", rmtNodeAddrs=" + U.addressesAsString(node) +
+                        ", locNodeId=" + locNode.id() + ", rmtNodeId=" + msg.creatorNodeId() + ']';
+
+                    LT.warn(log, null, errMsg);
+
+                    // Always output in debug.
+                    if (log.isDebugEnabled())
+                        log.debug(errMsg);
+
+                    try {
+                        String sndMsg = "Local node's " + IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID +
+                            " property value differs from remote node's value " +
+                            "(to make sure all nodes in topology have identical marshaller settings, " +
+                            "configure system property explicitly) " +
+                            "[locMarshUseDfltSuid=" + locMarshUseDfltSuid +
+                            ", rmtMarshUseDfltSuid=" + rmtMarshUseDfltSuid +
+                            ", locNodeAddrs=" + U.addressesAsString(node) + ", locPort=" + node.discoveryPort() +
+                            ", rmtNodeAddr=" + U.addressesAsString(locNode) + ", locNodeId=" + node.id() +
+                            ", rmtNodeId=" + locNode.id() + ']';
+
+                        trySendMessageDirectly(node,
+                            new TcpDiscoveryCheckFailedMessage(locNodeId, sndMsg));
+                    }
+                    catch (IgniteSpiException e) {
+                        if (log.isDebugEnabled())
+                            log.debug("Failed to send marshaller check failed message to node " +
+                                "[node=" + node + ", err=" + e.getMessage() + ']');
+
+                        onException("Failed to send marshaller check failed message to node " +
+                            "[node=" + node + ", err=" + e.getMessage() + ']', e);
+                    }
+
+                    // Ignore join request.
+                    return;
+                }
+
                 // Handle join.
                 node.internalOrder(ring.nextNodeOrder());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
index dc73cff..6e2c635 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
@@ -17,18 +17,15 @@
 
 package org.apache.ignite.internal.managers.discovery;
 
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.DeploymentMode;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteNodeAttributes;
+import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 import static org.apache.ignite.configuration.DeploymentMode.CONTINUOUS;
@@ -123,6 +120,43 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends GridCommonA
     /**
      * @throws Exception If failed.
      */
+    public void testUseDefaultSuid() throws Exception {
+        doTestUseDefaultSuid(true, false, true);
+        doTestUseDefaultSuid(false, true, true);
+        doTestUseDefaultSuid(true, true, false);
+        doTestUseDefaultSuid(false, false, false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void doTestUseDefaultSuid(Boolean first, Boolean second, boolean fail) throws Exception {
+        try {
+            GridTestUtils.setFieldValue(null, OptimizedMarshaller.class, "USE_DFLT_SUID", first);
+
+            startGrid(0);
+
+            GridTestUtils.setFieldValue(null, OptimizedMarshaller.class, "USE_DFLT_SUID", second);
+
+            try {
+                startGrid(1);
+
+                if (fail)
+                    fail("Node should not join");
+            }
+            catch (Exception e) {
+                if (!fail)
+                    fail("Node should join");
+            }
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testDifferentDeploymentModes() throws Exception {
         startGrid(0);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9aa4d10/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
index be3f0e4..ea3bbe0 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
@@ -27,6 +27,7 @@ import java.lang.ref.SoftReference;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.net.InetAddress;
 import java.net.MulticastSocket;
 import java.nio.file.attribute.PosixFilePermission;
@@ -1139,7 +1140,6 @@ public final class GridTestUtils {
      */
     @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
     public static void setFieldValue(Object obj, Class cls, String fieldName, Object val) throws IgniteException {
-        assert obj != null;
         assert fieldName != null;
 
         try {
@@ -1149,16 +1149,33 @@ public final class GridTestUtils {
                 // Backup accessible field state.
                 boolean accessible = field.isAccessible();
 
+                boolean isFinal = (field.getModifiers() & Modifier.FINAL) > 0;
+
+                Field modifiersField = null;
+
+                if (isFinal)
+                    modifiersField = Field.class.getDeclaredField("modifiers");
+
                 try {
                     if (!accessible)
                         field.setAccessible(true);
 
+                    if (isFinal) {
+                        modifiersField.setAccessible(true);
+                        modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
+                    }
+
                     field.set(obj, val);
                 }
                 finally {
                     // Recover accessible field state.
                     if (!accessible)
                         field.setAccessible(false);
+
+                    if (isFinal) {
+                        modifiersField.setInt(field, field.getModifiers() | Modifier.FINAL);
+                        modifiersField.setAccessible(false);
+                    }
                 }
             }
         }


[14/16] ignite git commit: ignite-1792: ContinuousProcessor should use ALWAYS_TRUE predicate instead of null

Posted by dm...@apache.org.
ignite-1792: ContinuousProcessor should use ALWAYS_TRUE predicate instead of null


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

Branch: refs/heads/ignite-801
Commit: b5a30693498c17e5ecea04dd19c8608f54321076
Parents: e9aa4d1
Author: Andrey Gura <ag...@gridgain.com>
Authored: Tue Oct 27 14:03:27 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Oct 27 14:03:27 2015 +0300

----------------------------------------------------------------------
 .../cache/query/continuous/CacheContinuousQueryManager.java    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b5a30693/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index 6a151a5..c7bf091 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
@@ -419,10 +419,8 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter {
             taskNameHash,
             skipPrimaryCheck);
 
-        IgnitePredicate<ClusterNode> pred = null;
-
-        if (loc || cctx.config().getCacheMode() == CacheMode.LOCAL)
-            pred = F.nodeForNodeId(cctx.localNodeId());
+        IgnitePredicate<ClusterNode> pred = (loc || cctx.config().getCacheMode() == CacheMode.LOCAL) ?
+            F.nodeForNodeId(cctx.localNodeId()) : F.<ClusterNode>alwaysTrue();
 
         UUID id = cctx.kernalContext().continuous().startRoutine(
             hnd,


[03/16] ignite git commit: IGNITE-1653

Posted by dm...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/User.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/User.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/User.java
new file mode 100644
index 0000000..d0486f5
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/User.java
@@ -0,0 +1,154 @@
+/*
+ * 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.examples.datagrid.hibernate;
+
+import java.util.HashSet;
+import java.util.Set;
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import org.hibernate.annotations.NaturalId;
+
+/**
+ * A user entity class. Represents a user of some public service,
+ * having a number of personal information fields as well as a
+ * number of posts written.
+ */
+@Entity
+class User {
+    /** ID. */
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    private long id;
+
+    /** Login. */
+    @NaturalId
+    private String login;
+
+    /** First name. */
+    private String firstName;
+
+    /** Last name. */
+    private String lastName;
+
+    /** Posts. */
+    @OneToMany(mappedBy = "author", cascade = CascadeType.ALL)
+    private Set<Post> posts = new HashSet<>();
+
+    /**
+     * Default constructor (required by Hibernate).
+     */
+    User() {
+        // No-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param login Login.
+     * @param firstName First name.
+     * @param lastName Last name.
+     */
+    User(String login, String firstName, String lastName) {
+        this.login = login;
+        this.firstName = firstName;
+        this.lastName = lastName;
+    }
+
+    /**
+     * @return ID.
+     */
+    public long getId() {
+        return id;
+    }
+
+    /**
+     * @param id New ID.
+     */
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    /**
+     * @return Login.
+     */
+    public String getLogin() {
+        return login;
+    }
+
+    /**
+     * @param login New login.
+     */
+    public void setLogin(String login) {
+        this.login = login;
+    }
+
+    /**
+     * @return First name.
+     */
+    public String getFirstName() {
+        return firstName;
+    }
+
+    /**
+     * @param firstName New first name.
+     */
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    /**
+     * @return Last name.
+     */
+    public String getLastName() {
+        return lastName;
+    }
+
+    /**
+     * @param lastName New last name.
+     */
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    /**
+     * @return Posts.
+     */
+    public Set<Post> getPosts() {
+        return posts;
+    }
+
+    /**
+     * @param posts New posts.
+     */
+    public void setPosts(Set<Post> posts) {
+        this.posts = posts;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return "User [id=" + id +
+            ", login=" + login +
+            ", firstName=" + firstName +
+            ", lastName=" + lastName +
+            ']';
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/package-info.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/package-info.java
new file mode 100644
index 0000000..7bddaaf
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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 description. -->
+ * Hibernate example.
+ */
+package org.apache.ignite.examples.datagrid.hibernate;

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernatePersonStore.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernatePersonStore.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernatePersonStore.java
new file mode 100644
index 0000000..d040b88
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernatePersonStore.java
@@ -0,0 +1,122 @@
+/*
+ * 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.examples.datagrid.store.hibernate;
+
+import java.util.List;
+import java.util.UUID;
+import javax.cache.integration.CacheLoaderException;
+import javax.cache.integration.CacheWriterException;
+import org.apache.ignite.cache.store.CacheStore;
+import org.apache.ignite.cache.store.CacheStoreAdapter;
+import org.apache.ignite.cache.store.CacheStoreSession;
+import org.apache.ignite.examples.datagrid.store.Person;
+import org.apache.ignite.lang.IgniteBiInClosure;
+import org.apache.ignite.resources.CacheStoreSessionResource;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+
+/**
+ * Example of {@link CacheStore} implementation that uses Hibernate
+ * and deals with maps {@link UUID} to {@link Person}.
+ */
+public class CacheHibernatePersonStore extends CacheStoreAdapter<Long, Person> {
+    /** Auto-injected store session. */
+    @CacheStoreSessionResource
+    private CacheStoreSession ses;
+
+    /** {@inheritDoc} */
+    @Override public Person load(Long key) {
+        System.out.println(">>> Store load [key=" + key + ']');
+
+        Session hibSes = ses.attachment();
+
+        try {
+            return (Person)hibSes.get(Person.class, key);
+        }
+        catch (HibernateException e) {
+            throw new CacheLoaderException("Failed to load value from cache store [key=" + key + ']', e);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void write(javax.cache.Cache.Entry<? extends Long, ? extends Person> entry) {
+        Long key = entry.getKey();
+        Person val = entry.getValue();
+
+        System.out.println(">>> Store write [key=" + key + ", val=" + val + ']');
+
+        Session hibSes = ses.attachment();
+
+        try {
+            hibSes.saveOrUpdate(val);
+        }
+        catch (HibernateException e) {
+            throw new CacheWriterException("Failed to put value to cache store [key=" + key + ", val" + val + "]", e);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"JpaQueryApiInspection"})
+    @Override public void delete(Object key) {
+        System.out.println(">>> Store delete [key=" + key + ']');
+
+        Session hibSes = ses.attachment();
+
+        try {
+            hibSes.createQuery("delete " + Person.class.getSimpleName() + " where key = :key").
+                setParameter("key", key).
+                executeUpdate();
+        }
+        catch (HibernateException e) {
+            throw new CacheWriterException("Failed to remove value from cache store [key=" + key + ']', e);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void loadCache(IgniteBiInClosure<Long, Person> clo, Object... args) {
+        if (args == null || args.length == 0 || args[0] == null)
+            throw new CacheLoaderException("Expected entry count parameter is not provided.");
+
+        final int entryCnt = (Integer)args[0];
+
+        Session hibSes = ses.attachment();
+
+        try {
+            int cnt = 0;
+
+            List list = hibSes.createCriteria(Person.class).
+                setMaxResults(entryCnt).
+                list();
+
+            if (list != null) {
+                for (Object obj : list) {
+                    Person person = (Person)obj;
+
+                    clo.apply(person.getId(), person);
+
+                    cnt++;
+                }
+            }
+
+            System.out.println(">>> Loaded " + cnt + " values into cache.");
+        }
+        catch (HibernateException e) {
+            throw new CacheLoaderException("Failed to load values from cache store.", e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
new file mode 100644
index 0000000..f993d81
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
@@ -0,0 +1,151 @@
+/*
+ * 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.examples.datagrid.store.hibernate;
+
+import java.util.UUID;
+import javax.cache.configuration.Factory;
+import javax.cache.configuration.FactoryBuilder;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.cache.store.CacheStoreSessionListener;
+import org.apache.ignite.cache.store.hibernate.CacheHibernateStoreSessionListener;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.examples.ExampleNodeStartup;
+import org.apache.ignite.examples.ExamplesUtils;
+import org.apache.ignite.examples.datagrid.store.Person;
+import org.apache.ignite.transactions.Transaction;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+
+/**
+ * Demonstrates usage of cache with underlying persistent store configured.
+ * <p>
+ * This example uses {@link CacheHibernatePersonStore} as a persistent store.
+ * <p>
+ * Remote nodes can be started with {@link ExampleNodeStartup} in another JVM which will
+ * start node with {@code examples/config/example-ignite.xml} configuration.
+ */
+public class CacheHibernateStoreExample {
+    /** Hibernate configuration resource path. */
+    private static final String HIBERNATE_CFG =
+        "/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml";
+
+    /** Cache name. */
+    private static final String CACHE_NAME = CacheHibernateStoreExample.class.getSimpleName();
+
+    /** Heap size required to run this example. */
+    public static final int MIN_MEMORY = 1024 * 1024 * 1024;
+
+    /** Number of entries to load. */
+    private static final int ENTRY_COUNT = 100_000;
+
+    /** Global person ID to use across entire example. */
+    private static final Long id = Math.abs(UUID.randomUUID().getLeastSignificantBits());
+
+    /**
+     * Executes example.
+     *
+     * @param args Command line arguments, none required.
+     * @throws IgniteException If example execution failed.
+     */
+    public static void main(String[] args) throws IgniteException {
+        ExamplesUtils.checkMinMemory(MIN_MEMORY);
+
+        // To start ignite with desired configuration uncomment the appropriate line.
+        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
+            System.out.println();
+            System.out.println(">>> Cache store example started.");
+
+            CacheConfiguration<Long, Person> cacheCfg = new CacheConfiguration<>(CACHE_NAME);
+
+            // Set atomicity as transaction, since we are showing transactions in example.
+            cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+            // Configure Hibernate store.
+            cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheHibernatePersonStore.class));
+
+            // Configure Hibernate session listener.
+            cacheCfg.setCacheStoreSessionListenerFactories(new Factory<CacheStoreSessionListener>() {
+                @Override public CacheStoreSessionListener create() {
+                    CacheHibernateStoreSessionListener lsnr = new CacheHibernateStoreSessionListener();
+
+                    lsnr.setHibernateConfigurationPath(HIBERNATE_CFG);
+
+                    return lsnr;
+                }
+            });
+
+            cacheCfg.setReadThrough(true);
+            cacheCfg.setWriteThrough(true);
+
+            try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg)) {
+                // Make initial cache loading from persistent store. This is a
+                // distributed operation and will call CacheStore.loadCache(...)
+                // method on all nodes in topology.
+                loadCache(cache);
+
+                // Start transaction and execute several cache operations with
+                // read/write-through to persistent store.
+                executeTransaction(cache);
+            }
+        }
+    }
+
+    /**
+     * Makes initial cache loading.
+     *
+     * @param cache Cache to load.
+     */
+    private static void loadCache(IgniteCache<Long, Person> cache) {
+        long start = System.currentTimeMillis();
+
+        // Start loading cache from persistent store on all caching nodes.
+        cache.loadCache(null, ENTRY_COUNT);
+
+        long end = System.currentTimeMillis();
+
+        System.out.println(">>> Loaded " + cache.size() + " keys with backups in " + (end - start) + "ms.");
+    }
+
+    /**
+     * Executes transaction with read/write-through to persistent store.
+     *
+     * @param cache Cache to execute transaction on.
+     */
+    private static void executeTransaction(IgniteCache<Long, Person> cache) {
+        try (Transaction tx = Ignition.ignite().transactions().txStart()) {
+            Person val = cache.get(id);
+
+            System.out.println("Read value: " + val);
+
+            val = cache.getAndPut(id, new Person(id, "Isaac", "Newton"));
+
+            System.out.println("Overwrote old value: " + val);
+
+            val = cache.get(id);
+
+            System.out.println("Read value: " + val);
+
+            tx.commit();
+        }
+
+        System.out.println("Read value after commit: " + cache.get(id));
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
new file mode 100644
index 0000000..035ab98
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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 hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+    <class name="org.apache.ignite.examples.datagrid.store.Person" table="PERSONS">
+        <!-- ID. -->
+        <id name="id"/>
+
+        <!-- We only map data we are interested in. -->
+        <property name="firstName"/>
+        <property name="lastName"/>
+    </class>
+</hibernate-mapping>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
new file mode 100644
index 0000000..80a43e7
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<!--
+  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 hibernate-configuration PUBLIC
+        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
+
+<!--
+    Hibernate configuration.
+-->
+<hibernate-configuration>
+    <session-factory>
+        <!-- Database connection settings (private in-memory database). -->
+        <property name="connection.url">jdbc:h2:mem:example;DB_CLOSE_DELAY=-1</property>
+
+        <!-- Only validate the database schema on startup in production mode. -->
+        <property name="hbm2ddl.auto">update</property>
+
+        <!-- Do not output SQL. -->
+        <property name="show_sql">false</property>
+
+        <!-- Mappings. -->
+        <mapping resource="org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml"/>
+    </session-factory>
+</hibernate-configuration>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/package-info.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/package-info.java
new file mode 100644
index 0000000..7210b49
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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 description. -->
+ * Contains Hibernate-based cache store implementation.
+ */
+package org.apache.ignite.examples.datagrid.store.hibernate;

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/misc/schedule/ComputeScheduleExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/misc/schedule/ComputeScheduleExample.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/misc/schedule/ComputeScheduleExample.java
new file mode 100644
index 0000000..f8d0660
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/misc/schedule/ComputeScheduleExample.java
@@ -0,0 +1,82 @@
+/*
+ * 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.examples.misc.schedule;
+
+import java.util.concurrent.Callable;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.examples.ExampleNodeStartup;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.scheduler.SchedulerFuture;
+
+/**
+ * Demonstrates a cron-based {@link Runnable} execution scheduling.
+ * Test runnable object broadcasts a phrase to all cluster nodes every minute
+ * three times with initial scheduling delay equal to five seconds.
+ * <p>
+ * Remote nodes should always be started with special configuration file which
+ * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
+ * <p>
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will start node
+ * with {@code examples/config/example-ignite.xml} configuration.
+ */
+public class ComputeScheduleExample {
+    /**
+     * Executes example.
+     *
+     * @param args Command line arguments, none required.
+     * @throws IgniteException If example execution failed.
+     */
+    public static void main(String[] args) throws IgniteException {
+        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
+            System.out.println();
+            System.out.println("Compute schedule example started.");
+
+            // Schedule output message every minute.
+            SchedulerFuture<?> fut = ignite.scheduler().scheduleLocal(
+                new Callable<Integer>() {
+                    private int invocations;
+
+                    @Override public Integer call() {
+                        invocations++;
+
+                        ignite.compute().broadcast(
+                            new IgniteRunnable() {
+                                @Override public void run() {
+                                    System.out.println();
+                                    System.out.println("Howdy! :)");
+                                }
+                            }
+                        );
+
+                        return invocations;
+                    }
+                },
+                "{5, 3} * * * * *" // Cron expression.
+            );
+
+            while (!fut.isDone())
+                System.out.println(">>> Invocation #: " + fut.get());
+
+            System.out.println();
+            System.out.println(">>> Schedule future is done and has been unscheduled.");
+            System.out.println(">>> Check all nodes for hello message output.");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/main/java-lgpl/org/apache/ignite/examples/misc/schedule/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/misc/schedule/package-info.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/misc/schedule/package-info.java
new file mode 100644
index 0000000..6602a6e
--- /dev/null
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/misc/schedule/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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 description. -->
+ * Demonstrates usage of cron-based scheduler.
+ */
+package org.apache.ignite.examples.misc.schedule;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/test/java-lgpl/org/apache/ignite/examples/HibernateL2CacheExampleMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java-lgpl/org/apache/ignite/examples/HibernateL2CacheExampleMultiNodeSelfTest.java b/examples/src/test/java-lgpl/org/apache/ignite/examples/HibernateL2CacheExampleMultiNodeSelfTest.java
new file mode 100644
index 0000000..8a40d4a
--- /dev/null
+++ b/examples/src/test/java-lgpl/org/apache/ignite/examples/HibernateL2CacheExampleMultiNodeSelfTest.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.examples;
+
+import org.apache.ignite.examples.datagrid.hibernate.HibernateL2CacheExample;
+
+/**
+ * Multi-node test for {@link HibernateL2CacheExample}.
+ */
+public class HibernateL2CacheExampleMultiNodeSelfTest extends HibernateL2CacheExampleSelfTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        for (int i = 0; i < RMT_NODES_CNT; i++)
+            startGrid("node-" + i, "examples/config/example-ignite.xml");
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/test/java-lgpl/org/apache/ignite/examples/HibernateL2CacheExampleSelfTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java-lgpl/org/apache/ignite/examples/HibernateL2CacheExampleSelfTest.java b/examples/src/test/java-lgpl/org/apache/ignite/examples/HibernateL2CacheExampleSelfTest.java
new file mode 100644
index 0000000..68767d7
--- /dev/null
+++ b/examples/src/test/java-lgpl/org/apache/ignite/examples/HibernateL2CacheExampleSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.examples;
+
+import org.apache.ignite.examples.datagrid.hibernate.HibernateL2CacheExample;
+import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
+
+/**
+ * Tests the {@link HibernateL2CacheExample}.
+ */
+public class HibernateL2CacheExampleSelfTest extends GridAbstractExamplesTest {
+    /**
+     * @throws Exception If failed.
+     */
+    public void testHibernateL2CacheExample() throws Exception {
+        HibernateL2CacheExample.main(EMPTY_ARGS);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/examples/src/test/java-lgpl/org/apache/ignite/testsuites/IgniteLgplExamplesSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java-lgpl/org/apache/ignite/testsuites/IgniteLgplExamplesSelfTestSuite.java b/examples/src/test/java-lgpl/org/apache/ignite/testsuites/IgniteLgplExamplesSelfTestSuite.java
new file mode 100644
index 0000000..7c99712
--- /dev/null
+++ b/examples/src/test/java-lgpl/org/apache/ignite/testsuites/IgniteLgplExamplesSelfTestSuite.java
@@ -0,0 +1,48 @@
+/*
+ *  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.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.examples.HibernateL2CacheExampleMultiNodeSelfTest;
+import org.apache.ignite.examples.HibernateL2CacheExampleSelfTest;
+import org.apache.ignite.testframework.GridTestUtils;
+
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_OVERRIDE_MCAST_GRP;
+
+/**
+ * Examples test suite. <p> Contains only Spring ignite examples tests.
+ */
+public class IgniteLgplExamplesSelfTestSuite extends TestSuite {
+    /**
+     * @return Suite.
+     * @throws Exception If failed.
+     */
+    public static TestSuite suite() throws Exception {
+        System.setProperty(IGNITE_OVERRIDE_MCAST_GRP,
+            GridTestUtils.getNextMulticastGroup(IgniteLgplExamplesSelfTestSuite.class));
+
+        TestSuite suite = new TestSuite("Ignite Examples Test Suite");
+
+        suite.addTest(new TestSuite(HibernateL2CacheExampleSelfTest.class));
+
+        // Multi-node.
+        suite.addTest(new TestSuite(HibernateL2CacheExampleMultiNodeSelfTest.class));
+
+        return suite;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bd2cd923/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6eeb006..5f06555 100644
--- a/pom.xml
+++ b/pom.xml
@@ -153,63 +153,6 @@
                 <module>modules/geospatial</module>
                 <module>modules/schedule</module>
             </modules>
-
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-assembly-plugin</artifactId>
-                        <dependencies>
-                            <dependency>
-                                <groupId>org.apache.apache.resources</groupId>
-                                <artifactId>apache-source-release-assembly-descriptor</artifactId>
-                                <version>1.0.4</version>
-                            </dependency>
-                        </dependencies>
-                        <executions>
-                            <execution>
-                                <id>release-lgpl</id>
-                                <phase>prepare-package</phase>
-                                <goals>
-                                    <goal>single</goal>
-                                </goals>
-                                <configuration>
-                                    <descriptors>
-                                        <descriptor>assembly/release-${ignite.edition}-lgpl.xml</descriptor>
-                                    </descriptors>
-                                    <finalName>release-package</finalName>
-                                    <appendAssemblyId>false</appendAssemblyId>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-antrun-plugin</artifactId>
-                        <version>1.7</version>
-                        <inherited>false</inherited>
-                        <executions>
-                            <execution>
-                                <id>release-postprocessing-lgpl</id>
-                                <goals>
-                                    <goal>run</goal>
-                                </goals>
-                                <phase>package</phase>
-                                <configuration>
-                                    <target>
-                                        <replaceregexp file="${basedir}/target/release-package/examples-lgpl/pom.xml"
-                                                       byline="true">
-                                            <regexp pattern="to_be_replaced_by_ignite_version"/>
-                                            <substitution expression="${project.version}"/>
-                                        </replaceregexp>
-                                    </target>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-
-                </plugins>
-            </build>
         </profile>
 
         <profile>
@@ -533,13 +476,6 @@
         </profile>
 
         <profile>
-            <id>examples-lgpl</id>
-            <modules>
-                <module>examples-lgpl</module>
-            </modules>
-        </profile>
-
-        <profile>
             <id>apache-release</id>
             <build>
                 <plugins>


[10/16] ignite git commit: ignite-1272: support of custom class loaders and conditional deployment info for portable marshaller and portable caches

Posted by dm...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
index 4422952..578f6de 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
@@ -207,7 +207,8 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                         cctx.cacheId(),
                         req.id(),
                         new IgniteCheckedException("Received request for incorrect cache [expected=" + cctx.name() +
-                            ", actual=" + req.cacheName()));
+                            ", actual=" + req.cacheName()),
+                        cctx.deploymentEnabled());
 
                     sendQueryResponse(sndId, res, 0);
                 }
@@ -228,7 +229,8 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                     catch (Throwable e) {
                         U.error(log(), "Failed to run query.", e);
 
-                        sendQueryResponse(sndId, new GridCacheQueryResponse(cctx.cacheId(), req.id(), e.getCause()), 0);
+                        sendQueryResponse(sndId, new GridCacheQueryResponse(cctx.cacheId(), req.id(), e.getCause(),
+                            cctx.deploymentEnabled()), 0);
 
                         if (e instanceof Error)
                             throw (Error)e;
@@ -445,7 +447,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                 fut.onPage(null, null, e, true);
             else
                 sendQueryResponse(qryInfo.senderId(),
-                    new GridCacheQueryResponse(cctx.cacheId(), qryInfo.requestId(), e),
+                    new GridCacheQueryResponse(cctx.cacheId(), qryInfo.requestId(), e, cctx.deploymentEnabled()),
                     qryInfo.query().timeout());
 
             return true;
@@ -455,7 +457,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
             fut.onPage(null, data, null, finished);
         else {
             GridCacheQueryResponse res = new GridCacheQueryResponse(cctx.cacheId(), qryInfo.requestId(),
-                /*finished*/false, /*fields*/false);
+                /*finished*/false, /*fields*/false, cctx.deploymentEnabled());
 
             res.data(data);
             res.finished(finished);
@@ -484,7 +486,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
             }
             else
                 sendQueryResponse(qryInfo.senderId(),
-                    new GridCacheQueryResponse(cctx.cacheId(), qryInfo.requestId(), e),
+                    new GridCacheQueryResponse(cctx.cacheId(), qryInfo.requestId(), e, cctx.deploymentEnabled()),
                     qryInfo.query().timeout());
 
             return true;
@@ -497,7 +499,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
         }
         else {
             GridCacheQueryResponse res = new GridCacheQueryResponse(cctx.cacheId(), qryInfo.requestId(),
-                finished, qryInfo.reducer() == null);
+                finished, qryInfo.reducer() == null, cctx.deploymentEnabled());
 
             res.metadata(metadata);
             res.data(entities != null ? entities : data);
@@ -567,7 +569,8 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                 qry.query().keepPortable(),
                 qry.query().subjectId(),
                 qry.query().taskHash(),
-                queryTopologyVersion());
+                queryTopologyVersion(),
+                cctx.deploymentEnabled());
 
             addQueryFuture(req.id(), fut);
 
@@ -612,7 +615,8 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                 qry.keepPortable(),
                 qry.subjectId(),
                 qry.taskHash(),
-                queryTopologyVersion());
+                queryTopologyVersion(),
+                cctx.deploymentEnabled());
 
             sendRequest(fut, req, nodes);
         }
@@ -678,7 +682,8 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                 qry.query().keepPortable(),
                 qry.query().subjectId(),
                 qry.query().taskHash(),
-                queryTopologyVersion());
+                queryTopologyVersion(),
+                cctx.deploymentEnabled());
 
             addQueryFuture(req.id(), fut);
 
@@ -823,4 +828,4 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
             return S.toString(CancelMessageId.class, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
index c9ce933..c7feda4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
@@ -139,15 +139,18 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
      * @param id Request to cancel.
      * @param fields Fields query flag.
      * @param topVer Topology version.
+     * @param addDepInfo Deployment info flag.
      */
     public GridCacheQueryRequest(int cacheId,
         long id,
         boolean fields,
-        AffinityTopologyVersion topVer) {
+        AffinityTopologyVersion topVer,
+        boolean addDepInfo) {
         this.cacheId = cacheId;
         this.id = id;
         this.fields = fields;
         this.topVer = topVer;
+        this.addDepInfo = addDepInfo;
 
         cancel = true;
     }
@@ -166,6 +169,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
      * @param subjId Subject ID.
      * @param taskHash Task name hash code.
      * @param topVer Topology version.
+     * @param addDepInfo Deployment info flag.
      */
     public GridCacheQueryRequest(
         int cacheId,
@@ -178,7 +182,8 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
         boolean keepPortable,
         UUID subjId,
         int taskHash,
-        AffinityTopologyVersion topVer
+        AffinityTopologyVersion topVer,
+        boolean addDepInfo
     ) {
         this.cacheId = cacheId;
         this.id = id;
@@ -191,6 +196,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
         this.subjId = subjId;
         this.taskHash = taskHash;
         this.topVer = topVer;
+        this.addDepInfo = addDepInfo;
     }
 
     /**
@@ -213,6 +219,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
      * @param subjId Subject ID.
      * @param taskHash Task name hash code.
      * @param topVer Topology version.
+     * @param addDepInfo Deployment info flag.
      */
     public GridCacheQueryRequest(
         int cacheId,
@@ -233,7 +240,8 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
         boolean keepPortable,
         UUID subjId,
         int taskHash,
-        AffinityTopologyVersion topVer
+        AffinityTopologyVersion topVer,
+        boolean addDepInfo
     ) {
         assert type != null || fields;
         assert clause != null || (type == SCAN || type == SET || type == SPI);
@@ -258,6 +266,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
         this.subjId = subjId;
         this.taskHash = taskHash;
         this.topVer = topVer;
+        this.addDepInfo = addDepInfo;
     }
 
     /** {@inheritDoc} */
@@ -269,34 +278,36 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
     @Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
         super.prepareMarshal(ctx);
 
+        GridCacheContext cctx = ctx.cacheContext(cacheId);
+
         if (keyValFilter != null) {
-            if (ctx.deploymentEnabled())
-                prepareObject(keyValFilter, ctx);
+            if (addDepInfo)
+                prepareObject(keyValFilter, cctx);
 
-            keyValFilterBytes = CU.marshal(ctx, keyValFilter);
+            keyValFilterBytes = CU.marshal(cctx, keyValFilter);
         }
 
         if (rdc != null) {
-            if (ctx.deploymentEnabled())
-                prepareObject(rdc, ctx);
+            if (addDepInfo)
+                prepareObject(rdc, cctx);
 
-            rdcBytes = CU.marshal(ctx, rdc);
+            rdcBytes = CU.marshal(cctx, rdc);
         }
 
         if (trans != null) {
-            if (ctx.deploymentEnabled())
-                prepareObject(trans, ctx);
+            if (addDepInfo)
+                prepareObject(trans, cctx);
 
-            transBytes = CU.marshal(ctx, trans);
+            transBytes = CU.marshal(cctx, trans);
         }
 
         if (!F.isEmpty(args)) {
-            if (ctx.deploymentEnabled()) {
+            if (addDepInfo) {
                 for (Object arg : args)
-                    prepareObject(arg, ctx);
+                    prepareObject(arg, cctx);
             }
 
-            argsBytes = CU.marshal(ctx, args);
+            argsBytes = CU.marshal(cctx, args);
         }
     }
 
@@ -319,6 +330,11 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
             args = mrsh.unmarshal(argsBytes, ldr);
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
     /**
      * @param ctx Context.
      * @throws IgniteCheckedException In case of error.

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java
index 78e2ac7..cce465b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java
@@ -25,6 +25,7 @@ import java.util.Map;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.GridDirectCollection;
 import org.apache.ignite.internal.GridDirectTransient;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheDeployable;
 import org.apache.ignite.internal.processors.cache.GridCacheMessage;
 import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
@@ -89,23 +90,28 @@ public class GridCacheQueryResponse extends GridCacheMessage implements GridCach
      * @param reqId Request id.
      * @param finished Last response or not.
      * @param fields Fields query or not.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridCacheQueryResponse(int cacheId, long reqId, boolean finished, boolean fields) {
+    public GridCacheQueryResponse(int cacheId, long reqId, boolean finished, boolean fields, boolean addDepInfo) {
         this.cacheId = cacheId;
         this.reqId = reqId;
         this.finished = finished;
         this.fields = fields;
+        this.addDepInfo = addDepInfo;
     }
 
     /**
      * @param cacheId Cache ID.
      * @param reqId Request id.
      * @param err Error.
+     * @param addDepInfo Deployment info flag.
      */
-    public GridCacheQueryResponse(int cacheId, long reqId, Throwable err) {
+    public GridCacheQueryResponse(int cacheId, long reqId, Throwable err, boolean addDepInfo) {
         this.cacheId = cacheId;
         this.reqId = reqId;
         this.err = err;
+        this.addDepInfo = addDepInfo;
+
         finished = true;
     }
 
@@ -114,19 +120,21 @@ public class GridCacheQueryResponse extends GridCacheMessage implements GridCach
     @Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
         super.prepareMarshal(ctx);
 
+        GridCacheContext cctx = ctx.cacheContext(cacheId);
+
         if (err != null)
             errBytes = ctx.marshaller().marshal(err);
 
-        metaDataBytes = marshalCollection(metadata, ctx);
-        dataBytes = marshalCollection(data, ctx);
+        metaDataBytes = marshalCollection(metadata, cctx);
+        dataBytes = marshalCollection(data, cctx);
 
-        if (ctx.deploymentEnabled() && !F.isEmpty(data)) {
+        if (addDepInfo && !F.isEmpty(data)) {
             for (Object o : data) {
                 if (o instanceof Map.Entry) {
                     Map.Entry e = (Map.Entry)o;
 
-                    prepareObject(e.getKey(), ctx);
-                    prepareObject(e.getValue(), ctx);
+                    prepareObject(e.getKey(), cctx);
+                    prepareObject(e.getValue(), cctx);
                 }
             }
         }
@@ -143,6 +151,11 @@ public class GridCacheQueryResponse extends GridCacheMessage implements GridCach
         data = unmarshalCollection(dataBytes, ctx, ldr);
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean addDeploymentInfo() {
+        return addDepInfo;
+    }
+
     /**
      * @return Metadata.
      */
@@ -339,4 +352,4 @@ public class GridCacheQueryResponse extends GridCacheMessage implements GridCach
     @Override public String toString() {
         return S.toString(GridCacheQueryResponse.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index 1990e18..e517c70 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -233,12 +233,10 @@ class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler {
                         locLsnr.onUpdated(F.<CacheEntryEvent<? extends K, ? extends V>>asList(evt));
                     else {
                         try {
-                            if (ctx.config().isPeerClassLoadingEnabled() && ctx.discovery().node(nodeId) != null) {
+                            if (cctx.deploymentEnabled() && ctx.discovery().node(nodeId) != null) {
                                 evt.entry().prepareMarshal(cctx);
 
-                                GridCacheDeploymentManager depMgr = cctx.deploy();
-
-                                depMgr.prepare(evt.entry());
+                                cctx.deploy().prepare(evt.entry());
                             }
                             else
                                 evt.entry().prepareMarshal(cctx);
@@ -551,4 +549,4 @@ class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler {
             depInfo = (GridDeploymentInfo)in.readObject();
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
index 11cd3fd..20fb8c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
@@ -280,6 +280,12 @@ public interface IgniteInternalTx extends AutoCloseable, GridTimeoutObject {
     public Collection<Integer> activeCacheIds();
 
     /**
+     * @return {@code true} or {@code false} if the deployment is enabled or disabled for all active caches involved
+     * in this transaction.
+     */
+    public boolean activeCachesDeploymentEnabled();
+
+    /**
      * Attempts to set topology version and returns the current value.
      * If topology version was previously set, then it's value will
      * be returned (but not updated).
@@ -722,4 +728,4 @@ public interface IgniteInternalTx extends AutoCloseable, GridTimeoutObject {
      * @param topVer New topology version.
      */
     public void onRemap(AffinityTopologyVersion topVer);
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 88752a2..7d7e3e8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -1757,6 +1757,11 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
         }
 
         /** {@inheritDoc} */
+        @Override public boolean activeCachesDeploymentEnabled() {
+            return false;
+        }
+
+        /** {@inheritDoc} */
         @Nullable @Override public Object addMeta(int key, Object val) {
             throw new IllegalStateException("Deserialized transaction can only be used as read-only.");
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 3c33d19..2462dda 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -735,13 +735,13 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
         if (filters != null) {
             for (CacheEntryPredicate p : filters) {
                 if (p != null)
-                    p.prepareMarshal(ctx.cacheContext(cacheId));
+                    p.prepareMarshal(this.ctx);
             }
         }
 
         // Do not serialize filters if they are null.
         if (transformClosBytes == null && entryProcessorsCol != null)
-            transformClosBytes = CU.marshal(ctx, entryProcessorsCol);
+            transformClosBytes = CU.marshal(this.ctx, entryProcessorsCol);
 
         if (transferExpiry)
             transferExpiryPlc = expiryPlc != null && expiryPlc != this.ctx.expiry();
@@ -750,7 +750,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
 
         val.marshal(ctx, context());
 
-        expiryPlcBytes = transferExpiryPlc ?  CU.marshal(ctx, new IgniteExternalizableExpiryPolicy(expiryPlc)) : null;
+        expiryPlcBytes = transferExpiryPlc ?  CU.marshal(this.ctx, new IgniteExternalizableExpiryPolicy(expiryPlc)) : null;
     }
 
     /**
@@ -1038,4 +1038,4 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
         return GridToStringBuilder.toString(IgniteTxEntry.class, this, "xidVer", tx == null ? "null" : tx.xidVersion());
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index c2cc629..530fbdf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -241,7 +241,8 @@ public class IgniteTxHandler {
                         req.version(),
                         null,
                         e,
-                        null);
+                        null,
+                        req.deployInfo() != null);
                 }
             }
         });
@@ -327,7 +328,8 @@ public class IgniteTxHandler {
                         req.version(),
                         null,
                         null,
-                        top.topologyVersion());
+                        top.topologyVersion(),
+                        req.deployInfo() != null);
 
                     try {
                         ctx.io().send(nearNode, res, req.policy());
@@ -787,7 +789,7 @@ public class IgniteTxHandler {
         GridDhtTxPrepareResponse res;
 
         try {
-            res = new GridDhtTxPrepareResponse(req.version(), req.futureId(), req.miniId());
+            res = new GridDhtTxPrepareResponse(req.version(), req.futureId(), req.miniId(), req.deployInfo() != null);
 
             // Start near transaction first.
             nearTx = !F.isEmpty(req.nearWrites()) ? startNearRemoteTx(ctx.deploy().globalLoader(), nodeId, req) : null;
@@ -833,7 +835,8 @@ public class IgniteTxHandler {
             if (nearTx != null)
                 nearTx.rollback();
 
-            res = new GridDhtTxPrepareResponse(req.version(), req.futureId(), req.miniId(), e);
+            res = new GridDhtTxPrepareResponse(req.version(), req.futureId(), req.miniId(), e,
+                req.deployInfo() != null);
         }
 
         try {
@@ -1344,7 +1347,8 @@ public class IgniteTxHandler {
         GridCacheTxRecoveryRequest req,
         boolean prepared) {
         GridCacheTxRecoveryResponse res =
-            new GridCacheTxRecoveryResponse(req.version(), req.futureId(), req.miniId(), prepared);
+            new GridCacheTxRecoveryResponse(req.version(), req.futureId(), req.miniId(), prepared,
+                req.deployInfo() != null);
 
         try {
             if (log.isDebugEnabled())
@@ -1382,4 +1386,4 @@ public class IgniteTxHandler {
 
         fut.onResult(nodeId, res);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index aa0ffe8..f22e753 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -164,6 +164,9 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     /** Implicit transaction result. */
     protected GridCacheReturn implicitRes;
 
+    /** Flag indicating whether deployment is enabled for caches from this transaction or not. */
+    private boolean depEnabled;
+
     /**
      * Empty constructor required for {@link Externalizable}.
      */
@@ -276,6 +279,11 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     }
 
     /** {@inheritDoc} */
+    @Override public boolean activeCachesDeploymentEnabled() {
+        return depEnabled;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean isStarted() {
         return txMap != null;
     }
@@ -3234,6 +3242,9 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
             }
             else
                 activeCacheIds.add(cacheId);
+
+            if (activeCacheIds.size() == 1)
+                depEnabled = cacheCtx.deploymentEnabled();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index 6e7fadd..0bc102e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -91,7 +91,7 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
 
     /** {@inheritDoc} */
     @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException {
-        return CU.marshal(ctx.kernalContext().cache().context(), val);
+        return CU.marshal(ctx.kernalContext().cache().context(), ctx.addDeploymentInfo(), val);
     }
 
     /** {@inheritDoc} */
@@ -209,7 +209,8 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
         CacheObjectContext res = new CacheObjectContext(ctx,
             ccfg.getAffinityMapper() != null ? ccfg.getAffinityMapper() : new GridCacheDefaultAffinityKeyMapper(),
             ccfg.isCopyOnRead() && memMode != OFFHEAP_VALUES,
-            storeVal);
+            storeVal,
+            ctx.config().isPeerClassLoadingEnabled() && !isPortableEnabled(ccfg));
 
         ctx.resource().injectGeneric(res.defaultAffMapper());
 
@@ -392,4 +393,4 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
             return new CacheObjectByteArrayImpl(valCpy);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/marshaller/AbstractMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/AbstractMarshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/AbstractMarshaller.java
index 8c79a93..dd5bad0 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/AbstractMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/AbstractMarshaller.java
@@ -37,6 +37,16 @@ public abstract class AbstractMarshaller implements Marshaller {
     /** Context. */
     protected MarshallerContext ctx;
 
+
+    /**
+     * Undeployment callback invoked when class loader is being undeployed.
+     *
+     * Some marshallers may want to clean their internal state that uses the undeployed class loader somehow.
+     *
+     * @param ldr Class loader being undeployed.
+     */
+    public abstract void onUndeploy(ClassLoader ldr);
+
     /** {@inheritDoc} */
     @Override public void setContext(MarshallerContext ctx) {
         this.ctx = ctx;
@@ -71,4 +81,4 @@ public abstract class AbstractMarshaller implements Marshaller {
             U.close(in, null);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java
index 0f4cf1f..deb3953 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java
@@ -115,7 +115,12 @@ public class JdkMarshaller extends AbstractMarshaller {
     }
 
     /** {@inheritDoc} */
+    @Override public void onUndeploy(ClassLoader ldr) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(JdkMarshaller.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java
index b9b782a..caccd99 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshaller.java
@@ -288,7 +288,7 @@ public class OptimizedMarshaller extends AbstractMarshaller {
      *
      * @param ldr Class loader being undeployed.
      */
-    public void onUndeploy(ClassLoader ldr) {
+    @Override public void onUndeploy(ClassLoader ldr) {
         for (Class<?> cls : clsMap.keySet()) {
             if (ldr.equals(cls.getClassLoader()))
                 clsMap.remove(cls);
@@ -296,4 +296,4 @@ public class OptimizedMarshaller extends AbstractMarshaller {
 
         U.clearClassCache(ldr);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java
new file mode 100644
index 0000000..0873d2d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.util.HashSet;
+import java.util.Map;
+import javax.cache.processor.EntryProcessorResult;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheEntryProcessor;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DeploymentMode;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheRebalanceMode.SYNC;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/**
+ * Cache EntryProcessor + Deployment.
+ */
+public class GridCacheAtomicEntryProcessorDeploymentSelfTest extends GridCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** Entry processor */
+    protected static String TEST_ENT_PROCESSOR = "org.apache.ignite.tests.p2p.CacheDeploymentEntryProcessor";
+
+    /** Test value. */
+    protected static String TEST_VALUE = "org.apache.ignite.tests.p2p.CacheDeploymentTestValue";
+
+    /** */
+    private DeploymentMode depMode;
+
+    /** */
+    private boolean cliendMode;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        if (cliendMode)
+            cfg.setClientMode(cliendMode);
+
+        cfg.setDeploymentMode(depMode);
+
+        cfg.setCacheConfiguration(cacheConfiguration());
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(disco);
+
+        cfg.setConnectorConfiguration(null);
+
+        return cfg;
+    }
+
+    /**
+     * @return Cache configuration.
+     * @throws Exception In case of error.
+     */
+    protected CacheConfiguration cacheConfiguration() throws Exception {
+        CacheConfiguration cfg = defaultCacheConfiguration();
+
+        cfg.setCacheMode(PARTITIONED);
+        cfg.setWriteSynchronizationMode(FULL_SYNC);
+        cfg.setRebalanceMode(SYNC);
+        cfg.setAtomicityMode(atomicityMode());
+        cfg.setNearConfiguration(new NearCacheConfiguration());
+        cfg.setBackups(1);
+
+        return cfg;
+    }
+
+    protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    public void testInvokeDeployment() throws Exception {
+        depMode = DeploymentMode.CONTINUOUS;
+
+        doTestInvoke();
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    public void testInvokeDeployment2() throws Exception {
+        depMode = DeploymentMode.SHARED;
+
+        doTestInvoke();
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    public void testInvokeAllDeployment() throws Exception {
+        depMode = DeploymentMode.CONTINUOUS;
+
+        doTestInvokeAll();
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    public void testInvokeAllDeployment2() throws Exception {
+        depMode = DeploymentMode.SHARED;
+
+        doTestInvokeAll();
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    private void doTestInvoke() throws Exception {
+        try {
+            cliendMode = false;
+            startGrid(0);
+
+            cliendMode = true;
+            startGrid(1);
+
+            ClassLoader ldr = getExternalClassLoader();
+
+            Class procCls = ldr.loadClass(TEST_ENT_PROCESSOR);
+            Class valCls = ldr.loadClass(TEST_VALUE);
+
+            assertTrue(grid(1).configuration().isClientMode());
+
+            IgniteCache cache = grid(1).cache(null);
+
+            cache.put("key", valCls.newInstance());
+
+            Boolean res = (Boolean)cache.invoke("key", (CacheEntryProcessor)procCls.newInstance());
+
+            assertTrue(res);
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    private void doTestInvokeAll() throws Exception {
+        try {
+            cliendMode = false;
+            startGrid(0);
+
+            cliendMode = true;
+            startGrid(1);
+
+            ClassLoader ldr = getExternalClassLoader();
+
+            Class procCls = ldr.loadClass(TEST_ENT_PROCESSOR);
+            Class valCls = ldr.loadClass(TEST_VALUE);
+
+            assertTrue(grid(1).configuration().isClientMode());
+
+            IgniteCache cache = grid(1).cache(null);
+
+            HashSet keys = new HashSet();
+
+            for (int i = 0; i < 3; i++) {
+                String key = "key" + i;
+
+                cache.put(key, valCls.newInstance());
+
+                keys.add(key);
+            }
+
+            Map<String, EntryProcessorResult> res = (Map<String, EntryProcessorResult>)cache.invokeAll(keys,
+                (CacheEntryProcessor)procCls.newInstance());
+
+            assertEquals(3, res.size());
+
+            for (EntryProcessorResult result : res.values())
+                assertTrue((Boolean)result.get());
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java
new file mode 100644
index 0000000..c03eb08
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConditionalDeploymentSelfTest.java
@@ -0,0 +1,190 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.managers.communication.GridIoMessageFactory;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.typedef.CO;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheRebalanceMode.SYNC;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/**
+ * Cache + conditional deployment test.
+ */
+public class GridCacheConditionalDeploymentSelfTest extends GridCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /**
+     *
+     */
+    static {
+        GridIoMessageFactory.registerCustom(TestMessage.DIRECT_TYPE, new CO<Message>() {
+            @Override public Message apply() {
+                return new TestMessage();
+            }
+        });
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setCacheConfiguration(cacheConfiguration());
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(disco);
+
+        return cfg;
+    }
+
+    /**
+     * @return Cache configuration.
+     * @throws Exception In case of error.
+     */
+    protected CacheConfiguration cacheConfiguration() throws Exception {
+        CacheConfiguration cfg = defaultCacheConfiguration();
+
+        cfg.setCacheMode(PARTITIONED);
+        cfg.setWriteSynchronizationMode(FULL_SYNC);
+        cfg.setRebalanceMode(SYNC);
+        cfg.setAtomicityMode(TRANSACTIONAL);
+        cfg.setBackups(1);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        Ignite ignite0 = startGrid(0);
+
+        startGrid(1);
+
+        ignite0.cache(null).put(1, new TestValue());
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        Ignition.stopAll(true);
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    public void testNoDeploymentInfo() throws Exception {
+        GridCacheIoManager ioMgr = cacheIoManager();
+
+        TestMessage msg = new TestMessage();
+
+        assertNull(msg.deployInfo());
+
+        msg.addDepInfo = false;
+
+        IgniteUtils.invoke(GridCacheIoManager.class, ioMgr, "onSend", msg, grid(1).cluster().localNode().id());
+
+        assertNull(msg.deployInfo());
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    public void testAddedDeploymentInfo() throws Exception {
+        GridCacheIoManager ioMgr = cacheIoManager();
+
+        TestMessage msg = new TestMessage();
+
+        assertNull(msg.deployInfo());
+
+        msg.addDepInfo = true;
+
+        IgniteUtils.invoke(GridCacheIoManager.class, ioMgr, "onSend", msg, grid(1).cluster().localNode().id());
+
+        assertNotNull(msg.deployInfo());
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    public void testAddedDeploymentInfo2() throws Exception {
+        GridCacheContext ctx = cacheContext();
+
+        assertTrue(ctx.deploymentEnabled());
+
+        GridCacheIoManager ioMgr = cacheIoManager();
+
+        TestMessage msg = new TestMessage();
+
+        assertNull(msg.deployInfo());
+
+        msg.addDepInfo = false;
+
+        IgniteUtils.invoke(GridCacheIoManager.class, ioMgr, "onSend", msg, grid(1).cluster().localNode().id());
+
+        assertNull(msg.deployInfo());
+    }
+
+    protected GridCacheContext cacheContext() {
+        return ((IgniteCacheProxy)grid(0).cache(null)).context();
+    }
+
+    protected GridCacheIoManager cacheIoManager() {
+        return grid(0).context().cache().context().io();
+    }
+
+    /**
+     * Test message class.
+     */
+    public static class TestMessage  extends GridCacheMessage implements GridCacheDeployable {
+        /** */
+        public static final byte DIRECT_TYPE = (byte)302;
+
+        @Override public byte directType() {
+            return DIRECT_TYPE;
+        }
+
+        @Override public byte fieldsCount() {
+            return 3;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean addDeploymentInfo() {
+            return addDepInfo;
+        }
+    }
+
+    /** */
+    private static class TestValue {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java
index c51d72b..1adc3b4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java
@@ -38,19 +38,4 @@ public class GridCacheDeploymentOffHeapSelfTest extends GridCacheDeploymentSelfT
 
         return cacheCfg;
     }
-
-    /** {@inheritDoc} */
-    @Override public void testDeployment() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-1618");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void testDeployment6() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-1618");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void testDeployment7() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-1618");
-    }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
index 5965852..e18520d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
@@ -48,28 +48,28 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
     private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
 
     /** Name for grid without cache. */
-    private static final String GRID_NAME = "grid-no-cache";
+    protected static final String GRID_NAME = "grid-no-cache";
 
     /** First test task name. */
-    private static final String TEST_TASK_1 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask1";
+    protected static final String TEST_TASK_1 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask1";
 
     /** Second test task name. */
-    private static final String TEST_TASK_2 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask2";
+    protected static final String TEST_TASK_2 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask2";
 
     /** Third test task name. */
-    private static final String TEST_TASK_3 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask3";
+    protected static final String TEST_TASK_3 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask3";
 
     /** Test value 1. */
-    private static final String TEST_KEY = "org.apache.ignite.tests.p2p.CacheDeploymentTestKey";
+    protected static final String TEST_KEY = "org.apache.ignite.tests.p2p.CacheDeploymentTestKey";
 
     /** Test value 1. */
-    private static final String TEST_VALUE_1 = "org.apache.ignite.tests.p2p.CacheDeploymentTestValue";
+    protected static final String TEST_VALUE_1 = "org.apache.ignite.tests.p2p.CacheDeploymentTestValue";
 
     /** Test value 2. */
-    private static final String TEST_VALUE_2 = "org.apache.ignite.tests.p2p.CacheDeploymentTestValue2";
+    protected static final String TEST_VALUE_2 = "org.apache.ignite.tests.p2p.CacheDeploymentTestValue2";
 
     /** */
-    private DeploymentMode depMode;
+    protected DeploymentMode depMode;
 
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
@@ -249,11 +249,11 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
 
             stopGrid(GRID_NAME);
 
-            assert g1.cache(null).localSize(CachePeekMode.ALL) == 1;
-            assert g1.cache(null).localSize(CachePeekMode.ALL) == 1;
+            assertEquals(1, g1.cache(null).localSize(CachePeekMode.ALL));
+            assertEquals(1, g1.cache(null).localSize(CachePeekMode.ALL));
 
-            assert g2.cache(null).localSize(CachePeekMode.ALL) == 1;
-            assert g2.cache(null).localSize(CachePeekMode.ALL) == 1;
+            assertEquals(1, g2.cache(null).localSize(CachePeekMode.ALL));
+            assertEquals(1, g2.cache(null).localSize(CachePeekMode.ALL));
 
             startGrid(3);
         }
@@ -436,4 +436,4 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
         throw new IllegalStateException("Unable to find matching key [start=" + start + ", primary=" + primary.id() +
             ", backup=" + backup.id() + ']');
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalEntryProcessorDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalEntryProcessorDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalEntryProcessorDeploymentSelfTest.java
new file mode 100644
index 0000000..bf8cc7a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalEntryProcessorDeploymentSelfTest.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.internal.processors.cache;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+
+/**
+ * Cache EntryProcessor + Deployment for transactional cache.
+ */
+public class GridCacheTransactionalEntryProcessorDeploymentSelfTest extends
+    GridCacheAtomicEntryProcessorDeploymentSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.TRANSACTIONAL;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/spi/communication/GridCacheMessageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridCacheMessageSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridCacheMessageSelfTest.java
index 47dcdf1..9c97542 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridCacheMessageSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridCacheMessageSelfTest.java
@@ -215,6 +215,11 @@ public class GridCacheMessageSelfTest extends GridCommonAbstractTest {
             entries.add(entry);
         }
 
+        /** {@inheritDoc} */
+        @Override public boolean addDeploymentInfo() {
+            return false;
+        }
+
         /**
          * @return COllection of test messages.
          */
@@ -305,6 +310,11 @@ public class GridCacheMessageSelfTest extends GridCommonAbstractTest {
             this.body = body;
         }
 
+        /** {@inheritDoc} */
+        @Override public boolean addDeploymentInfo() {
+            return false;
+        }
+
         /**
          * @return Body.
          */
@@ -423,6 +433,11 @@ public class GridCacheMessageSelfTest extends GridCommonAbstractTest {
             this.body = body;
         }
 
+        /** {@inheritDoc} */
+        @Override public boolean addDeploymentInfo() {
+            return false;
+        }
+
         /**
          * @return Body.
          */
@@ -553,4 +568,4 @@ public class GridCacheMessageSelfTest extends GridCommonAbstractTest {
             return true;
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index 0e5894d..7ee301c 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -76,7 +76,7 @@ public class IgniteBasicTestSuite extends TestSuite {
         suite.addTest(IgniteKernalSelfTestSuite.suite(ignoredTests));
         suite.addTest(IgniteStartUpTestSuite.suite());
         suite.addTest(IgniteExternalizableSelfTestSuite.suite());
-        suite.addTest(IgniteP2PSelfTestSuite.suite());
+        suite.addTest(IgniteP2PSelfTestSuite.suite(ignoredTests));
         suite.addTest(IgniteCacheP2pUnmarshallingErrorTestSuite.suite(ignoredTests));
         suite.addTest(IgniteStreamSelfTestSuite.suite());
 
@@ -116,4 +116,4 @@ public class IgniteBasicTestSuite extends TestSuite {
 
         return suite;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 1deb3bc..a4737c2 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -169,15 +169,15 @@ public class IgniteCacheTestSuite extends TestSuite {
         suite.addTestSuite(IgnitePutAllUpdateNonPreloadedPartitionSelfTest.class);
 
         // User's class loader tests.
-        suite.addTestSuite(IgniteCacheAtomicExecutionContextTest.class);
-        suite.addTestSuite(IgniteCachePartitionedExecutionContextTest.class);
-        suite.addTestSuite(IgniteCacheReplicatedExecutionContextTest.class);
-        suite.addTestSuite(IgniteCacheTxExecutionContextTest.class);
-        suite.addTestSuite(IgniteCacheContinuousExecutionContextTest.class);
-        suite.addTestSuite(IgniteCacheIsolatedExecutionContextTest.class);
-        suite.addTestSuite(IgniteCacheP2PDisableExecutionContextTest.class);
-        suite.addTestSuite(IgniteCachePrivateExecutionContextTest.class);
-        suite.addTestSuite(IgniteCacheSharedExecutionContextTest.class);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCacheAtomicExecutionContextTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCachePartitionedExecutionContextTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCacheReplicatedExecutionContextTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCacheTxExecutionContextTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCacheContinuousExecutionContextTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCacheIsolatedExecutionContextTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCacheP2PDisableExecutionContextTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCachePrivateExecutionContextTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, IgniteCacheSharedExecutionContextTest.class, ignoredTests);
 
         // Warmup closure tests.
         suite.addTestSuite(IgniteWarmupClosureSelfTest.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
index 02a7f7f..796c531 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
@@ -18,6 +18,8 @@
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.GridCacheAtomicEntryProcessorDeploymentSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheConditionalDeploymentSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheDeploymentOffHeapSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheDeploymentSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheEntryVersionSelfTest;
@@ -25,6 +27,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheOrderedPreloadingSel
 import org.apache.ignite.internal.processors.cache.GridCacheReferenceCleanupSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheReloadSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheReplicatedSynchronousCommitTest;
+import org.apache.ignite.internal.processors.cache.GridCacheTransactionalEntryProcessorDeploymentSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheValueBytesPreloadingSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheValueConsistencyTransactionalNearEnabledSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheValueConsistencyTransactionalSelfTest;
@@ -116,6 +119,9 @@ public class IgniteCacheTestSuite3 extends TestSuite {
 
         suite.addTestSuite(GridCacheDeploymentSelfTest.class);
         suite.addTestSuite(GridCacheDeploymentOffHeapSelfTest.class);
+        suite.addTestSuite(GridCacheConditionalDeploymentSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicEntryProcessorDeploymentSelfTest.class);
+        suite.addTestSuite(GridCacheTransactionalEntryProcessorDeploymentSelfTest.class);
 
         suite.addTestSuite(GridCachePutArrayValueSelfTest.class);
         suite.addTestSuite(GridCacheReplicatedUnswapAdvancedSelfTest.class);
@@ -183,4 +189,4 @@ public class IgniteCacheTestSuite3 extends TestSuite {
 
         return suite;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteP2PSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteP2PSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteP2PSelfTestSuite.java
index ddf7d37..7bade98 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteP2PSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteP2PSelfTestSuite.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.testsuites;
 
+import java.util.Set;
 import junit.framework.TestSuite;
 import org.apache.ignite.internal.managers.deployment.GridDeploymentMessageCountSelfTest;
 import org.apache.ignite.p2p.GridP2PClassLoadingSelfTest;
@@ -33,17 +34,26 @@ import org.apache.ignite.p2p.GridP2PRemoteClassLoadersSelfTest;
 import org.apache.ignite.p2p.GridP2PSameClassLoaderSelfTest;
 import org.apache.ignite.p2p.GridP2PTimeoutSelfTest;
 import org.apache.ignite.p2p.GridP2PUndeploySelfTest;
+import org.apache.ignite.testframework.GridTestUtils;
 
 /**
  * P2P test suite.
  */
 public class IgniteP2PSelfTestSuite extends TestSuite {
     /**
+     * @return Suite.
+     * @throws Exception If failed.
+     */
+    public static TestSuite suite() throws Exception {
+        return suite(null);
+    }
+
+    /**
      * @return P2P tests suite.
      * @throws Exception If failed.
      */
     @SuppressWarnings({"ProhibitedExceptionDeclared"})
-    public static TestSuite suite() throws Exception {
+    public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
         TestSuite suite = new TestSuite("Ignite P2P Test Suite");
 
         suite.addTest(new TestSuite(GridP2PDoubleDeploymentSelfTest.class));
@@ -60,8 +70,8 @@ public class IgniteP2PSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridP2PTimeoutSelfTest.class));
         suite.addTest(new TestSuite(GridP2PMissedResourceCacheSizeSelfTest.class));
         suite.addTest(new TestSuite(GridP2PContinuousDeploymentSelfTest.class));
-        suite.addTest(new TestSuite(GridDeploymentMessageCountSelfTest.class));
+        GridTestUtils.addTestIfNeeded(suite, GridDeploymentMessageCountSelfTest.class, ignoredTests);
 
         return suite;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentEntryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentEntryProcessor.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentEntryProcessor.java
new file mode 100644
index 0000000..3d66fec
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentEntryProcessor.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 javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import org.apache.ignite.cache.CacheEntryProcessor;
+
+/**
+ * Entry processor for {@code GridCacheEntryProcessorDeploymentSelfTest}.
+ */
+public class CacheDeploymentEntryProcessor implements CacheEntryProcessor<String, CacheDeploymentTestValue, Boolean> {
+    /** {@inheritDoc} */
+    @Override public Boolean process(MutableEntry<String, CacheDeploymentTestValue> entry,
+        Object... arguments) throws EntryProcessorException {
+        CacheDeploymentTestValue val = entry.getValue();
+
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/df931bd0/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentPortableEntryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentPortableEntryProcessor.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentPortableEntryProcessor.java
new file mode 100644
index 0000000..03d3efc
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentPortableEntryProcessor.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 javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import org.apache.ignite.cache.CacheEntryProcessor;
+
+/**
+ * Entry processor used by {@code GridCacheEntryProcessorDeploymentSelfTest}.
+ */
+public class CacheDeploymentPortableEntryProcessor implements CacheEntryProcessor<String, String, Boolean> {
+    /** {@inheritDoc} */
+    @Override public Boolean process(MutableEntry<String, String> entry, Object... arguments)
+        throws EntryProcessorException {
+        String val = entry.getKey();
+
+        return true;
+    }
+}


[15/16] ignite git commit: Merge remote-tracking branch 'remotes/apache-main/master' into ignite-801

Posted by dm...@apache.org.
Merge remote-tracking branch 'remotes/apache-main/master' into ignite-801


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

Branch: refs/heads/ignite-801
Commit: 5ea234c40ff041c78e05cd5deaf63e3a90fce21b
Parents: d8b2774 b5a3069
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Oct 27 14:30:44 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Oct 27 14:30:44 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |   5 +-
 assembly/dependencies-fabric-lgpl.xml           | 169 +++++++++++++
 assembly/dependencies-fabric.xml                |   3 +
 assembly/release-fabric-base.xml                | 107 ++++++++
 assembly/release-fabric-lgpl.xml                |  41 ++--
 assembly/release-fabric.xml                     |  85 +------
 assembly/release-hadoop-lgpl.xml                |  39 ---
 config/fabric-lgpl/default-config.xml           |  29 +++
 examples-lgpl/README.txt                        |  27 --
 examples-lgpl/config/example-cache.xml          |  73 ------
 examples-lgpl/config/example-ignite.xml         |  83 -------
 examples-lgpl/config/hibernate/README.txt       |   8 -
 .../hibernate/example-hibernate-L2-cache.xml    |  64 -----
 examples-lgpl/pom-standalone.xml                | 186 --------------
 examples-lgpl/pom.xml                           | 128 ----------
 .../hibernate/HibernateL2CacheExample.java      | 245 -------------------
 .../examples/datagrid/hibernate/Post.java       | 130 ----------
 .../examples/datagrid/hibernate/User.java       | 154 ------------
 .../datagrid/hibernate/package-info.java        |  22 --
 .../hibernate/CacheHibernatePersonStore.java    | 122 ---------
 .../hibernate/CacheHibernateStoreExample.java   | 151 ------------
 .../datagrid/store/hibernate/Person.hbm.xml     |  34 ---
 .../datagrid/store/hibernate/hibernate.cfg.xml  |  41 ----
 .../datagrid/store/hibernate/package-info.java  |  22 --
 .../misc/schedule/ComputeScheduleExample.java   |  82 -------
 .../examples/misc/schedule/package-info.java    |  22 --
 .../misc/schedule/ComputeScheduleExample.java   |  68 -----
 .../java8/misc/schedule/package-info.java       |  22 --
 .../ignite/examples/java8/package-info.java     |  23 --
 .../scalar/examples/ScalarScheduleExample.scala |  66 -----
 ...ibernateL2CacheExampleMultiNodeSelfTest.java |  31 ---
 .../HibernateL2CacheExampleSelfTest.java        |  33 ---
 .../IgniteLgplExamplesSelfTestSuite.java        |  48 ----
 ...ibernateL2CacheExampleMultiNodeSelfTest.java |  29 ---
 .../HibernateL2CacheExampleSelfTest.java        |  37 ---
 .../IgniteLgplExamplesJ8SelfTestSuite.java      |  46 ----
 .../ScalarLgplExamplesMultiNodeSelfTest.scala   |  33 ---
 .../examples/ScalarLgplExamplesSelfTest.scala   |  36 ---
 .../ScalarLgplExamplesSelfTestSuite.scala       |  37 ---
 examples/README-LGPL.txt                        |  33 +++
 examples/README.txt                             |  21 +-
 examples/config/hibernate/README.txt            |   8 +
 .../hibernate/example-hibernate-L2-cache.xml    |  64 +++++
 examples/pom-standalone-lgpl.xml                | 217 ++++++++++++++++
 examples/pom-standalone.xml                     | 156 ++++++------
 examples/pom.xml                                | 157 ++++++------
 .../hibernate/HibernateL2CacheExample.java      | 245 +++++++++++++++++++
 .../examples/datagrid/hibernate/Post.java       | 130 ++++++++++
 .../examples/datagrid/hibernate/User.java       | 154 ++++++++++++
 .../datagrid/hibernate/package-info.java        |  22 ++
 .../hibernate/CacheHibernatePersonStore.java    | 122 +++++++++
 .../hibernate/CacheHibernateStoreExample.java   | 151 ++++++++++++
 .../datagrid/store/hibernate/Person.hbm.xml     |  34 +++
 .../datagrid/store/hibernate/hibernate.cfg.xml  |  41 ++++
 .../datagrid/store/hibernate/package-info.java  |  22 ++
 .../misc/schedule/ComputeScheduleExample.java   |  82 +++++++
 .../examples/misc/schedule/package-info.java    |  22 ++
 ...ibernateL2CacheExampleMultiNodeSelfTest.java |  31 +++
 .../HibernateL2CacheExampleSelfTest.java        |  33 +++
 .../IgniteLgplExamplesSelfTestSuite.java        |  48 ++++
 .../apache/ignite/IgniteSystemProperties.java   |   9 +
 .../configuration/CacheConfiguration.java       |  28 ++-
 .../internal/GridEventConsumeHandler.java       |  19 +-
 .../apache/ignite/internal/IgniteKernal.java    |   2 +
 .../ignite/internal/IgniteNodeAttributes.java   |   3 +
 .../deployment/GridDeploymentLocalStore.java    |   8 +-
 .../GridDeploymentPerLoaderStore.java           |   8 +-
 .../GridDeploymentPerVersionStore.java          |   8 +-
 .../internal/portable/PortableContext.java      |  91 +++++--
 .../portable/api/PortableMarshaller.java        |   5 +
 .../processors/cache/CacheObjectContext.java    |  17 +-
 .../processors/cache/GridCacheContext.java      |  10 +-
 .../cache/GridCacheEvictionManager.java         |   5 +-
 .../cache/GridCacheEvictionRequest.java         |  18 +-
 .../cache/GridCacheEvictionResponse.java        |   7 +-
 .../processors/cache/GridCacheIoManager.java    |  34 ++-
 .../processors/cache/GridCacheMessage.java      |  72 ++++--
 .../cache/GridCacheSharedContext.java           |   3 +
 .../processors/cache/GridCacheUtils.java        |  18 +-
 .../distributed/GridCacheTtlUpdateRequest.java  |   7 +-
 .../distributed/GridCacheTxRecoveryFuture.java  |   9 +-
 .../distributed/GridCacheTxRecoveryRequest.java |   8 +-
 .../GridCacheTxRecoveryResponse.java            |  10 +-
 .../distributed/GridDistributedBaseMessage.java |  16 +-
 .../distributed/GridDistributedLockRequest.java |   8 +-
 .../GridDistributedLockResponse.java            |  20 +-
 .../GridDistributedTxFinishRequest.java         |   6 +-
 .../GridDistributedTxFinishResponse.java        |   7 +-
 .../GridDistributedTxPrepareRequest.java        |  13 +-
 .../GridDistributedTxPrepareResponse.java       |  12 +-
 .../GridDistributedTxRemoteAdapter.java         |   5 +
 .../GridDistributedUnlockRequest.java           |   7 +-
 .../dht/GridDhtAffinityAssignmentRequest.java   |   7 +-
 .../dht/GridDhtAffinityAssignmentResponse.java  |   7 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |   3 +-
 .../distributed/dht/GridDhtLockFuture.java      |   5 +-
 .../distributed/dht/GridDhtLockRequest.java     |   7 +-
 .../distributed/dht/GridDhtLockResponse.java    |  14 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |  22 +-
 .../distributed/dht/GridDhtTxFinishFuture.java  |   9 +-
 .../distributed/dht/GridDhtTxFinishRequest.java |   7 +-
 .../dht/GridDhtTxFinishResponse.java            |   2 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |   9 +-
 .../dht/GridDhtTxPrepareRequest.java            |  28 ++-
 .../dht/GridDhtTxPrepareResponse.java           |  13 +-
 .../distributed/dht/GridDhtUnlockRequest.java   |   7 +-
 .../dht/GridPartitionedGetFuture.java           |   3 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  12 +-
 .../GridDhtAtomicDeferredUpdateResponse.java    |  12 +-
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |   6 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |  25 +-
 .../dht/atomic/GridDhtAtomicUpdateResponse.java |  11 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  12 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java |  33 ++-
 .../atomic/GridNearAtomicUpdateResponse.java    |  11 +-
 .../dht/colocated/GridDhtColocatedCache.java    |   8 +-
 .../colocated/GridDhtColocatedLockFuture.java   |   3 +-
 .../dht/preloader/GridDhtForceKeysFuture.java   |   5 +-
 .../dht/preloader/GridDhtForceKeysRequest.java  |  35 ++-
 .../dht/preloader/GridDhtForceKeysResponse.java |  11 +-
 .../GridDhtPartitionDemandMessage.java          |   5 +
 .../GridDhtPartitionSupplyMessage.java          |   9 +-
 .../preloader/GridDhtPartitionSupplyPool.java   |  10 +-
 .../GridDhtPartitionsAbstractMessage.java       |   7 +-
 .../dht/preloader/GridDhtPreloader.java         |   3 +-
 .../distributed/near/GridNearGetFuture.java     |   5 +-
 .../distributed/near/GridNearGetRequest.java    |  12 +-
 .../distributed/near/GridNearGetResponse.java   |  12 +-
 .../distributed/near/GridNearLockFuture.java    |   3 +-
 .../distributed/near/GridNearLockRequest.java   |   8 +-
 .../distributed/near/GridNearLockResponse.java  |   8 +-
 .../near/GridNearOptimisticTxPrepareFuture.java |   3 +-
 .../GridNearPessimisticTxPrepareFuture.java     |   3 +-
 .../near/GridNearTransactionalCache.java        |   8 +-
 .../near/GridNearTxFinishFuture.java            |   8 +-
 .../near/GridNearTxFinishRequest.java           |   7 +-
 .../near/GridNearTxFinishResponse.java          |   2 +-
 .../near/GridNearTxPrepareRequest.java          |   8 +-
 .../near/GridNearTxPrepareResponse.java         |   8 +-
 .../distributed/near/GridNearUnlockRequest.java |   7 +-
 .../portable/CacheObjectPortableContext.java    |   6 +-
 .../CacheObjectPortableProcessorImpl.java       |   5 +-
 .../query/GridCacheDistributedQueryFuture.java  |   5 +-
 .../query/GridCacheDistributedQueryManager.java |  25 +-
 .../cache/query/GridCacheQueryRequest.java      |  46 ++--
 .../cache/query/GridCacheQueryResponse.java     |  29 ++-
 .../continuous/CacheContinuousQueryHandler.java |   8 +-
 .../continuous/CacheContinuousQueryManager.java |   6 +-
 .../cache/transactions/IgniteInternalTx.java    |   8 +-
 .../cache/transactions/IgniteTxAdapter.java     |   5 +
 .../cache/transactions/IgniteTxEntry.java       |   8 +-
 .../cache/transactions/IgniteTxHandler.java     |  16 +-
 .../transactions/IgniteTxLocalAdapter.java      |  11 +
 .../IgniteCacheObjectProcessorImpl.java         |   7 +-
 .../ignite/internal/util/lang/GridFunc.java     |   8 +-
 .../ignite/marshaller/AbstractMarshaller.java   |  12 +-
 .../ignite/marshaller/jdk/JdkMarshaller.java    |   7 +-
 .../optimized/OptimizedMarshaller.java          |  14 +-
 .../optimized/OptimizedMarshallerUtils.java     |  35 ++-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |  52 ++++
 modules/core/src/test/config/tests.properties   |   4 +-
 .../GridDiscoveryManagerAttributesSelfTest.java |  44 +++-
 ...eAtomicEntryProcessorDeploymentSelfTest.java | 211 ++++++++++++++++
 .../GridCacheConditionalDeploymentSelfTest.java | 190 ++++++++++++++
 .../GridCacheDeploymentOffHeapSelfTest.java     |  17 +-
 .../cache/GridCacheDeploymentSelfTest.java      |  26 +-
 ...ctionalEntryProcessorDeploymentSelfTest.java |  31 +++
 .../IgniteCacheEntryListenerAbstractTest.java   |  50 +++-
 .../communication/GridCacheMessageSelfTest.java |  17 +-
 .../tcp/TcpClientDiscoverySpiSelfTest.java      |   4 +-
 .../ignite/testframework/GridTestUtils.java     |  19 +-
 .../ignite/testsuites/IgniteBasicTestSuite.java |   4 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |  18 +-
 .../testsuites/IgniteCacheTestSuite3.java       |   8 +-
 .../testsuites/IgniteP2PSelfTestSuite.java      |  16 +-
 .../p2p/CacheDeploymentEntryProcessor.java      |  35 +++
 .../CacheDeploymentPortableEntryProcessor.java  |  35 +++
 modules/extdata/uri/pom.xml                     |  21 +-
 modules/spark-2.10/pom.xml                      |   4 +-
 modules/spark/pom.xml                           |   4 +-
 .../yardstick/IgniteBenchmarkArguments.java     |  11 +
 .../cache/IgniteCacheAbstractBenchmark.java     |  63 +++++
 .../cache/IgnitePutAllTxBenchmark.java          |   6 +-
 .../ipfinder/zk/ZookeeperIpFinderTestSuite.java |  32 +++
 parent/pom.xml                                  |   1 +
 pom.xml                                         |  64 -----
 186 files changed, 3684 insertions(+), 2894 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5ea234c4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------