http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
index fc548fd,a99df8b..01c9d0a
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
@@@ -25,9 -24,9 +25,8 @@@ import org.apache.ignite.internal.proce
  import org.apache.ignite.internal.processors.cache.distributed.dht.*;
  import org.apache.ignite.internal.processors.cache.transactions.*;
  import org.apache.ignite.internal.processors.cache.version.*;
- import org.apache.ignite.internal.util.lang.*;
  import org.apache.ignite.internal.util.typedef.*;
  import org.apache.ignite.internal.util.typedef.internal.*;
 -import org.apache.ignite.lang.*;
  import org.jetbrains.annotations.*;
  
  import java.util.*;
@@@ -115,12 -120,12 +120,12 @@@ public class GridNearCacheEntry extend
       * @return {@code True} if this entry was initialized by this call.
       * @throws GridCacheEntryRemovedException If this entry is obsolete.
       */
 -    public boolean initializeFromDht(long topVer) throws 
GridCacheEntryRemovedException {
 +    public boolean initializeFromDht(AffinityTopologyVersion topVer) throws 
GridCacheEntryRemovedException {
          while (true) {
-             GridDhtCacheEntry<K, V> entry = cctx.near().dht().peekExx(key);
+             GridDhtCacheEntry entry = cctx.near().dht().peekExx(key);
  
              if (entry != null) {
-                 GridCacheEntryInfo<K, V> e = entry.info();
+                 GridCacheEntryInfo e = entry.info();
  
                  if (e != null) {
                      GridCacheVersion enqueueVer = null;
@@@ -342,9 -333,17 +333,17 @@@
       * @throws GridCacheEntryRemovedException If entry was removed.
       */
      @SuppressWarnings({"RedundantTypeArguments"})
-     public boolean loadedValue(@Nullable IgniteInternalTx tx, UUID 
primaryNodeId, V val, byte[] valBytes,
-         GridCacheVersion ver, GridCacheVersion dhtVer, @Nullable 
GridCacheVersion expVer, long ttl, long expireTime,
-         boolean evt, AffinityTopologyVersion topVer, UUID subjId)
+     public boolean loadedValue(@Nullable IgniteInternalTx tx,
+         UUID primaryNodeId,
+         CacheObject val,
+         GridCacheVersion ver,
+         GridCacheVersion dhtVer,
+         @Nullable GridCacheVersion expVer,
+         long ttl,
+         long expireTime,
+         boolean evt,
 -        long topVer,
++        AffinityTopologyVersion topVer,
+         UUID subjId)
          throws IgniteCheckedException, GridCacheEntryRemovedException {
          boolean valid = valid(tx != null ? tx.topologyVersion() : 
cctx.affinity().affinityTopologyVersion());
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index 4d44635,6a8b2a2..9f8f550
--- 
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
@@@ -168,9 -161,9 +161,9 @@@ public final class GridNearGetFuture<K
       * Initializes future.
       */
      public void init() {
 -        long topVer = tx == null ? cctx.affinity().affinityTopologyVersion() 
: tx.topologyVersion();
 +        AffinityTopologyVersion topVer = tx == null ? 
cctx.affinity().affinityTopologyVersion() : tx.topologyVersion();
  
-         map(keys, Collections.<ClusterNode, LinkedHashMap<K, 
Boolean>>emptyMap(), topVer);
+         map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, 
Boolean>>emptyMap(), topVer);
  
          markInitialized();
      }
@@@ -276,9 -262,9 +262,11 @@@
       * @param mapped Mappings to check for duplicates.
       * @param topVer Topology version to map on.
       */
-     private void map(Collection<? extends K> keys,
-         Map<ClusterNode, LinkedHashMap<K, Boolean>> mapped,
-         final AffinityTopologyVersion topVer) {
 -    private void map(Collection<KeyCacheObject> keys,
++    private void map(
++        Collection<KeyCacheObject> keys,
+         Map<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>> mapped,
 -        final long topVer) {
++        final AffinityTopologyVersion topVer
++    ) {
          Collection<ClusterNode> affNodes = CU.affinityNodes(cctx, topVer);
  
          if (affNodes.isEmpty()) {
@@@ -347,9 -323,9 +325,9 @@@
                              remapKeys.add(key);
                      }
  
-                     AffinityTopologyVersion updTopVer = new 
AffinityTopologyVersion(ctx.discovery().topologyVersion());
 -                    long updTopVer = cctx.discovery().topologyVersion();
++                    AffinityTopologyVersion updTopVer = new 
AffinityTopologyVersion(cctx.discovery().topologyVersion());
  
 -                    assert updTopVer > topVer : "Got invalid partitions for 
local node but topology version did " +
 +                    assert updTopVer.compareTo(topVer) > 0 : "Got invalid 
partitions for local node but topology version did " +
                          "not change [topVer=" + topVer + ", updTopVer=" + 
updTopVer +
                          ", invalidParts=" + invalidParts + ']';
  
@@@ -420,9 -396,12 +398,14 @@@
       * @param savedVers Saved versions.
       * @return Map.
       */
-     private Map<K, GridCacheVersion> map(K key, Map<ClusterNode, 
LinkedHashMap<K, Boolean>> mappings,
-         AffinityTopologyVersion topVer, Map<ClusterNode, LinkedHashMap<K, 
Boolean>> mapped, Map<K, GridCacheVersion> savedVers) {
-         final GridNearCacheAdapter<K, V> near = cache();
 -    private Map<KeyCacheObject, GridCacheVersion> map(KeyCacheObject key,
++    private Map<KeyCacheObject, GridCacheVersion> map(
++        KeyCacheObject key,
+         Map<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>> mappings,
 -        long topVer,
++        AffinityTopologyVersion topVer,
+         Map<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>> mapped,
 -        Map<KeyCacheObject, GridCacheVersion> savedVers) {
++        Map<KeyCacheObject, GridCacheVersion> savedVers
++    ) {
+         final GridNearCacheAdapter near = cache();
  
          // Allow to get cached value from the local node.
          boolean allowLocRead = !forcePrimary || 
cctx.affinity().primary(cctx.localNode(), key, topVer);
@@@ -599,11 -577,11 +581,13 @@@
       * @param topVer Topology version
       * @return Result map.
       */
--    private Map<K, V> loadEntries(UUID nodeId,
-         Collection<K> keys,
-         Collection<GridCacheEntryInfo<K, V>> infos,
-         Map<K, GridCacheVersion> savedVers,
-         AffinityTopologyVersion topVer) {
++    private Map<K, V> loadEntries(
++        UUID nodeId,
+         Collection<KeyCacheObject> keys,
+         Collection<GridCacheEntryInfo> infos,
+         Map<KeyCacheObject, GridCacheVersion> savedVers,
 -        long topVer) {
++        AffinityTopologyVersion topVer
++    ) {
          boolean empty = F.isEmpty(keys);
  
          Map<K, V> map = empty ? Collections.<K, V>emptyMap() : new 
GridLeanMap<K, V>(keys.size());
@@@ -682,31 -654,24 +660,26 @@@
  
          /** Keys. */
          @GridToStringInclude
-         private LinkedHashMap<K, Boolean> keys;
+         private LinkedHashMap<KeyCacheObject, Boolean> keys;
  
          /** Saved entry versions. */
-         private Map<K, GridCacheVersion> savedVers;
+         private Map<KeyCacheObject, GridCacheVersion> savedVers;
  
          /** Topology version on which this future was mapped. */
 -        private long topVer;
 +        private AffinityTopologyVersion topVer;
  
          /**
-          * Empty constructor required for {@link Externalizable}.
-          */
-         public MiniFuture() {
-             // No-op.
-         }
- 
-         /**
           * @param node Node.
           * @param keys Keys.
           * @param savedVers Saved entry versions.
           * @param topVer Topology version.
           */
-         MiniFuture(ClusterNode node, LinkedHashMap<K, Boolean> keys, Map<K, 
GridCacheVersion> savedVers,
-             @NotNull AffinityTopologyVersion topVer) {
-             super(cctx.kernalContext());
- 
 -        MiniFuture(ClusterNode node,
++        MiniFuture(
++            ClusterNode node,
+             LinkedHashMap<KeyCacheObject, Boolean> keys,
+             Map<KeyCacheObject, GridCacheVersion> savedVers,
 -            long topVer) {
++            AffinityTopologyVersion topVer
++        ) {
              this.node = node;
              this.keys = keys;
              this.savedVers = savedVers;
@@@ -752,21 -717,22 +725,22 @@@
              if (log.isDebugEnabled())
                  log.debug("Remote node left grid while sending or waiting for 
reply (will retry): " + this);
  
-             AffinityTopologyVersion updTopVer = new 
AffinityTopologyVersion(ctx.discovery().topologyVersion());
 -            long updTopVer = cctx.discovery().topologyVersion();
++            AffinityTopologyVersion updTopVer = new 
AffinityTopologyVersion(cctx.discovery().topologyVersion());
  
 -            if (updTopVer > topVer) {
 +            if (updTopVer.compareTo(topVer) > 0) {
                  // Remap.
                  map(keys.keySet(), F.t(node, keys), updTopVer);
  
                  onDone(Collections.<K, V>emptyMap());
              }
              else {
-                 final RemapTimeoutObject timeout = new 
RemapTimeoutObject(ctx.config().getNetworkTimeout(), topVer, e);
+                 final RemapTimeoutObject timeout = new RemapTimeoutObject(
+                     cctx.kernalContext().config().getNetworkTimeout(), 
topVer, e);
  
-                 ctx.discovery().topologyFuture(topVer.topologyVersion() + 
1).listenAsync(new CI1<IgniteInternalFuture<Long>>() {
 -                cctx.discovery().topologyFuture(topVer + 1).listen(new 
CI1<IgniteInternalFuture<Long>>() {
++                cctx.discovery().topologyFuture(topVer.topologyVersion() + 
1).listen(new CI1<IgniteInternalFuture<Long>>() {
                      @Override public void apply(IgniteInternalFuture<Long> 
longIgniteFuture) {
                          if (timeout.finish()) {
-                             ctx.timeout().removeTimeoutObject(timeout);
+                             
cctx.kernalContext().timeout().removeTimeoutObject(timeout);
  
                              // Remap.
                              map(keys.keySet(), F.t(node, keys), 
cctx.affinity().affinityTopologyVersion());
@@@ -813,18 -779,18 +787,18 @@@
                      log.debug("Remapping mini get future [invalidParts=" + 
invalidParts + ", fut=" + this + ']');
  
                  // Need to wait for next topology version to remap.
-                 IgniteInternalFuture<Long> topFut = 
ctx.discovery().topologyFuture(rmtTopVer.topologyVersion());
 -                IgniteInternalFuture<Long> topFut = 
cctx.discovery().topologyFuture(rmtTopVer);
++                IgniteInternalFuture<Long> topFut = 
cctx.discovery().topologyFuture(rmtTopVer.topologyVersion());
  
-                 topFut.listenAsync(new CIX1<IgniteInternalFuture<Long>>() {
+                 topFut.listen(new CIX1<IgniteInternalFuture<Long>>() {
                      @Override public void applyx(IgniteInternalFuture<Long> 
fut) throws IgniteCheckedException {
                          long readyTopVer = fut.get();
  
                          // This will append new futures to compound list.
-                         map(F.view(keys.keySet(), new P1<K>() {
-                             @Override public boolean apply(K key) {
+                         map(F.view(keys.keySet(), new P1<KeyCacheObject>() {
+                             @Override public boolean apply(KeyCacheObject 
key) {
                                  return 
invalidParts.contains(cctx.affinity().partition(key));
                              }
 -                        }), F.t(node, keys), readyTopVer);
 +                        }), F.t(node, keys), new 
AffinityTopologyVersion(readyTopVer));
  
                          // It is critical to call onDone after adding futures 
to compound list.
                          onDone(loadEntries(node.id(), keys.keySet(), 
res.entries(), savedVers, topVer));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
index bfe6768,c58b0ec..1203950
--- 
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
@@@ -64,13 -70,8 +72,8 @@@ public class GridNearGetRequest extend
      /** Skip values flag. Used for {@code containsKey} method. */
      private boolean skipVals;
  
-     /** */
-     @GridToStringExclude
-     @GridDirectMap(keyType = byte[].class, valueType = boolean.class)
-     private LinkedHashMap<byte[], Boolean> keyBytes;
- 
      /** Topology version. */
 -    private long topVer;
 +    private AffinityTopologyVersion topVer;
  
      /** Subject ID. */
      private UUID subjId;
@@@ -108,10 -109,10 +111,10 @@@
          IgniteUuid futId,
          IgniteUuid miniId,
          GridCacheVersion ver,
-         LinkedHashMap<K, Boolean> keys,
+         LinkedHashMap<KeyCacheObject, Boolean> keys,
          boolean readThrough,
          boolean reload,
 -        long topVer,
 +        @NotNull AffinityTopologyVersion topVer,
          UUID subjId,
          int taskNameHash,
          long accessTtl,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index bab1691,9232188..df2ffde
--- 
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
@@@ -297,8 -286,8 +287,11 @@@ public final class GridNearLockFuture<K
       * @return Lock candidate.
       * @throws GridCacheEntryRemovedException If entry was removed.
       */
-     @Nullable private GridCacheMvccCandidate<K> 
addEntry(AffinityTopologyVersion topVer, GridNearCacheEntry<K, V> entry, UUID 
dhtNodeId)
 -    @Nullable private GridCacheMvccCandidate addEntry(long topVer, 
GridNearCacheEntry entry, UUID dhtNodeId)
--        throws GridCacheEntryRemovedException {
++    @Nullable private GridCacheMvccCandidate addEntry(
++        AffinityTopologyVersion topVer, 
++        GridNearCacheEntry entry, 
++        UUID dhtNodeId
++    ) throws GridCacheEntryRemovedException {
          // Check if lock acquisition is timed out.
          if (timedOut)
              return null;
@@@ -702,8 -691,8 +695,8 @@@
                      markInitialized();
                  }
                  else {
-                     fut.listenAsync(new 
CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
 -                    fut.listen(new CI1<IgniteInternalFuture<Long>>() {
 -                        @Override public void 
apply(IgniteInternalFuture<Long> t) {
++                    fut.listen(new 
CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
 +                        @Override public void 
apply(IgniteInternalFuture<AffinityTopologyVersion> t) {
                              mapOnTopology();
                          }
                      });
@@@ -1151,8 -1135,8 +1139,11 @@@
       * @return Near lock mapping.
       * @throws IgniteCheckedException If mapping for key failed.
       */
-     private GridNearLockMapping<K, V> map(K key, @Nullable 
GridNearLockMapping<K, V> mapping,
-         AffinityTopologyVersion topVer) throws IgniteCheckedException {
 -    private GridNearLockMapping map(KeyCacheObject key, @Nullable 
GridNearLockMapping mapping,
 -        long topVer) throws IgniteCheckedException {
++    private GridNearLockMapping map(
++        KeyCacheObject key, 
++        @Nullable GridNearLockMapping mapping,
++        AffinityTopologyVersion topVer
++    ) throws IgniteCheckedException {
          assert mapping == null || mapping.node() != null;
  
          ClusterNode primary = cctx.affinity().primary(key, topVer);
@@@ -1346,11 -1321,11 +1328,11 @@@
  
                  int i = 0;
  
 -                long topVer = topSnapshot.get().topologyVersion();
 +                AffinityTopologyVersion topVer = new 
AffinityTopologyVersion(topSnapshot.get().topologyVersion());
  
-                 for (K k : keys) {
+                 for (KeyCacheObject k : keys) {
                      while (true) {
-                         GridNearCacheEntry<K, V> entry = 
cctx.near().entryExx(k, topVer);
+                         GridNearCacheEntry entry = cctx.near().entryExx(k, 
topVer);
  
                          try {
                              if (res.dhtVersion(i) == null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
index 48608e6,1e75b5b..9b0ecc6
--- 
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
@@@ -18,8 -18,6 +18,7 @@@
  package org.apache.ignite.internal.processors.cache.distributed.near;
  
  import org.apache.ignite.*;
- import org.apache.ignite.internal.*;
 +import org.apache.ignite.internal.processors.affinity.*;
  import org.apache.ignite.internal.processors.cache.*;
  import org.apache.ignite.internal.processors.cache.distributed.*;
  import org.apache.ignite.internal.processors.cache.transactions.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index e772114,9818e70..038ea3f
--- 
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
@@@ -181,14 -186,14 +187,14 @@@ public class GridNearTransactionalCache
  
          GridCacheVersion obsoleteVer = ctx.versions().next();
  
-         List<K> keys = req.nearKeys();
+         List<KeyCacheObject> keys = req.nearKeys();
  
          if (keys != null) {
 -            long topVer = ctx.affinity().affinityTopologyVersion();
 +            AffinityTopologyVersion topVer = 
ctx.affinity().affinityTopologyVersion();
  
-             for (K key : keys) {
+             for (KeyCacheObject key : keys) {
                  while (true) {
-                     GridDistributedCacheEntry<K, V> entry = peekExx(key);
+                     GridDistributedCacheEntry entry = peekExx(key);
  
                      try {
                          if (entry != null) {
@@@ -441,7 -439,7 +440,7 @@@
       * @param topVer Topology version.
       * @return {@code True} if entry is locally mapped as a primary or back 
up node.
       */
-     protected boolean isNearLocallyMapped(GridCacheEntryEx<K, V> e, 
AffinityTopologyVersion topVer) {
 -    protected boolean isNearLocallyMapped(GridCacheEntryEx e, long topVer) {
++    protected boolean isNearLocallyMapped(GridCacheEntryEx e, 
AffinityTopologyVersion topVer) {
          return ctx.affinity().belongs(ctx.localNode(), e.key(), topVer);
      }
  
@@@ -452,7 -450,7 +451,7 @@@
       * @param topVer Topology version.
       * @return {@code True} if attempt was made to evict the entry.
       */
-     protected boolean evictNearEntry(GridCacheEntryEx<K, V> e, 
GridCacheVersion obsoleteVer, AffinityTopologyVersion topVer) {
 -    protected boolean evictNearEntry(GridCacheEntryEx e, GridCacheVersion 
obsoleteVer, long topVer) {
++    protected boolean evictNearEntry(GridCacheEntryEx e, GridCacheVersion 
obsoleteVer, AffinityTopologyVersion topVer) {
          assert e != null;
          assert obsoleteVer != null;
  
@@@ -489,9 -489,9 +490,9 @@@
                          break; // While.
  
                      try {
-                         GridCacheMvccCandidate<K> cand = 
entry.candidate(ctx.nodeId(), Thread.currentThread().getId());
+                         GridCacheMvccCandidate cand = 
entry.candidate(ctx.nodeId(), Thread.currentThread().getId());
  
 -                        long topVer = -1;
 +                        AffinityTopologyVersion topVer = 
AffinityTopologyVersion.NONE;
  
                          if (cand != null) {
                              assert cand.nearLocal() : "Got non-near-local 
candidate in near cache: " + cand;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index 85a40e9,8e3f6c7..5d1a306
--- 
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
@@@ -223,10 -215,10 +216,10 @@@ public final class GridNearTxFinishFutu
  
              if (super.onDone(tx, th != null ? th : err)) {
                  if (error() instanceof IgniteTxHeuristicCheckedException) {
 -                    long topVer = this.tx.topologyVersion();
 +                    AffinityTopologyVersion topVer = 
this.tx.topologyVersion();
  
-                     for (IgniteTxEntry<K, V> e : this.tx.writeMap().values()) 
{
-                         GridCacheContext<K, V> cacheCtx = e.context();
+                     for (IgniteTxEntry e : this.tx.writeMap().values()) {
+                         GridCacheContext cacheCtx = e.context();
  
                          try {
                              if (e.op() != NOOP && 
!cacheCtx.affinity().localNode(e.key(), topVer)) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
index eec5d58,4bf000a..015d400
--- 
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
@@@ -17,7 -17,7 +17,8 @@@
  
  package org.apache.ignite.internal.processors.cache.distributed.near;
  
 +import org.apache.ignite.internal.processors.affinity.*;
+ import org.apache.ignite.internal.managers.communication.*;
  import org.apache.ignite.internal.processors.cache.distributed.*;
  import org.apache.ignite.internal.processors.cache.version.*;
  import org.apache.ignite.internal.util.tostring.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index 1ee19de,69f3134..d5ff286
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@@ -20,8 -20,8 +20,9 @@@ package org.apache.ignite.internal.proc
  import org.apache.ignite.*;
  import org.apache.ignite.cluster.*;
  import org.apache.ignite.internal.*;
+ import org.apache.ignite.internal.managers.communication.*;
  import org.apache.ignite.internal.managers.discovery.*;
 +import org.apache.ignite.internal.processors.affinity.*;
  import org.apache.ignite.internal.processors.cache.*;
  import org.apache.ignite.internal.processors.cache.distributed.*;
  import org.apache.ignite.internal.processors.cache.distributed.dht.*;
@@@ -183,8 -186,8 +187,12 @@@ public class GridNearTxLocal extends Gr
      }
  
      /** {@inheritDoc} */
-     @Override protected IgniteInternalFuture<Boolean> addReader(long msgId, 
GridDhtCacheEntry<K, V> cached,
-         IgniteTxEntry<K, V> entry, AffinityTopologyVersion topVer) {
 -    @Override protected IgniteInternalFuture<Boolean> addReader(long msgId, 
GridDhtCacheEntry cached,
 -        IgniteTxEntry entry, long topVer) {
++    @Override protected IgniteInternalFuture<Boolean> addReader(
++        long msgId, 
++        GridDhtCacheEntry cached,
++        IgniteTxEntry entry,
++        AffinityTopologyVersion topVer
++    ) {
          // We are in near transaction, do not add local node as reader.
          return null;
      }
@@@ -1141,9 -1143,9 +1148,13 @@@
      }
  
      /** {@inheritDoc} */
-     @Override protected GridCacheEntryEx<K, V> entryEx(GridCacheContext<K, V> 
cacheCtx, IgniteTxKey<K> key, AffinityTopologyVersion topVer) {
 -    @Override protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, 
IgniteTxKey key, long topVer) {
++    @Override protected GridCacheEntryEx entryEx(
++        GridCacheContext cacheCtx, 
++        IgniteTxKey key, 
++        AffinityTopologyVersion topVer
++    ) {
          if (cacheCtx.isColocated()) {
-             IgniteTxEntry<K, V> txEntry = entry(key);
+             IgniteTxEntry txEntry = entry(key);
  
              if (txEntry == null)
                  return cacheCtx.colocated().entryExx(key.key(), topVer, true);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
index 9a81691,227f4d9..c269283
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
@@@ -22,17 -22,14 +22,15 @@@ import org.apache.ignite.cluster.*
  import org.apache.ignite.internal.*;
  import org.apache.ignite.internal.cluster.*;
  import org.apache.ignite.internal.managers.discovery.*;
 +import org.apache.ignite.internal.processors.affinity.*;
  import org.apache.ignite.internal.processors.cache.*;
  import org.apache.ignite.internal.processors.cache.distributed.*;
- import 
org.apache.ignite.internal.processors.cache.distributed.dht.colocated.*;
- import org.apache.ignite.internal.processors.cache.version.*;
- import org.apache.ignite.internal.util.*;
- import org.apache.ignite.lang.*;
- import org.apache.ignite.transactions.*;
  import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+ import 
org.apache.ignite.internal.processors.cache.distributed.dht.colocated.*;
  import org.apache.ignite.internal.processors.cache.transactions.*;
+ import org.apache.ignite.internal.processors.cache.version.*;
  import org.apache.ignite.internal.transactions.*;
+ import org.apache.ignite.internal.util.*;
  import org.apache.ignite.internal.util.future.*;
  import org.apache.ignite.internal.util.lang.*;
  import org.apache.ignite.internal.util.tostring.*;
@@@ -363,11 -355,14 +356,13 @@@ public final class GridNearTxPrepareFut
                      }
                  }
                  else {
-                     topFut.syncNotify(false);
- 
-                     topFut.listenAsync(new 
CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
 -                    topFut.listen(new CI1<IgniteInternalFuture<Long>>() {
 -                        @Override public void 
apply(IgniteInternalFuture<Long> t) {
++                    topFut.listen(new 
CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
 +                        @Override public void 
apply(IgniteInternalFuture<AffinityTopologyVersion> t) {
-                             prepare();
+                             cctx.kernalContext().closure().runLocalSafe(new 
GridPlainRunnable() {
 -                                @Override
 -                                public void run() {
++                                @Override public void run() {
+                                     prepare();
+                                 }
+                             });
                          }
                      });
                  }
@@@ -547,9 -542,9 +542,9 @@@
       *
       */
      private void preparePessimistic() {
-         Map<IgniteBiTuple<ClusterNode, Boolean>, GridDistributedTxMapping<K, 
V>> mappings = new HashMap<>();
+         Map<IgniteBiTuple<ClusterNode, Boolean>, GridDistributedTxMapping> 
mappings = new HashMap<>();
  
 -        long topVer = tx.topologyVersion();
 +        AffinityTopologyVersion topVer = tx.topologyVersion();
  
          txMapping = new GridDhtTxMapping<>();
  
@@@ -751,13 -746,13 +746,13 @@@
       * @throws IgniteCheckedException If transaction is group-lock and local 
node is not primary for key.
       * @return Mapping.
       */
-     private GridDistributedTxMapping<K, V> map(
-         IgniteTxEntry<K, V> entry,
+     private GridDistributedTxMapping map(
+         IgniteTxEntry entry,
 -        long topVer,
 +        AffinityTopologyVersion topVer,
-         GridDistributedTxMapping<K, V> cur,
+         GridDistributedTxMapping cur,
          boolean waitLock
      ) throws IgniteCheckedException {
-         GridCacheContext<K, V> cacheCtx = entry.context();
+         GridCacheContext cacheCtx = entry.context();
  
          List<ClusterNode> nodes = cacheCtx.affinity().nodes(entry.key(), 
topVer);
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
index 4cd82ef,f23db12..3c4aed8
--- 
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
@@@ -96,10 -95,10 +96,10 @@@ public class GridNearTxPrepareRequest e
       */
      public GridNearTxPrepareRequest(
          IgniteUuid futId,
-         @NotNull AffinityTopologyVersion topVer,
-         IgniteInternalTx<K, V> tx,
-         Collection<IgniteTxEntry<K, V>> reads,
-         Collection<IgniteTxEntry<K, V>> writes,
 -        long topVer,
++        AffinityTopologyVersion topVer,
+         IgniteInternalTx tx,
+         Collection<IgniteTxEntry> reads,
+         Collection<IgniteTxEntry> writes,
          IgniteTxKey grpLockKey,
          boolean partLock,
          boolean near,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/dr/GridCacheDrManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/dr/os/GridOsCacheDrManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
index 49e893b,849911d..272dca6
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
@@@ -72,11 -69,18 +70,19 @@@ public class GridLocalCache<K, V> exten
  
      /** {@inheritDoc} */
      @Override protected void init() {
-         map.setEntryFactory(new GridCacheMapEntryFactory<K, V>() {
+         map.setEntryFactory(new GridCacheMapEntryFactory() {
              /** {@inheritDoc} */
-             @Override public GridCacheMapEntry<K, V> 
create(GridCacheContext<K, V> ctx, AffinityTopologyVersion topVer,
-                 K key, int hash, V val, GridCacheMapEntry<K, V> next, long 
ttl, int hdrId) {
-                 return new GridLocalCacheEntry<>(ctx, key, hash, val, next, 
ttl, hdrId);
 -            @Override public GridCacheMapEntry create(GridCacheContext ctx,
 -                long topVer,
++            @Override public GridCacheMapEntry create(
++                GridCacheContext ctx,
++                AffinityTopologyVersion topVer,
+                 KeyCacheObject key,
+                 int hash,
+                 CacheObject val,
+                 GridCacheMapEntry next,
+                 long ttl,
 -                int hdrId)
 -            {
++                int hdrId
++            ) {
+                 return new GridLocalCacheEntry(ctx, key, hash, val, next, 
ttl, hdrId);
              }
          });
      }
@@@ -177,12 -183,12 +185,14 @@@
      }
  
      /** {@inheritDoc} */
--    @Override public void unlockAll(Collection<? extends K> keys,
-         IgnitePredicate<Cache.Entry<K, V>>[] filter) throws 
IgniteCheckedException {
 -        CacheEntryPredicate[] filter) throws IgniteCheckedException {
 -        long topVer = ctx.affinity().affinityTopologyVersion();
++    @Override public void unlockAll(
++        Collection<? extends K> keys,
++        CacheEntryPredicate[] filter
++    ) throws IgniteCheckedException {
 +        AffinityTopologyVersion topVer = 
ctx.affinity().affinityTopologyVersion();
  
          for (K key : keys) {
-             GridLocalCacheEntry<K, V> entry = peekExx(key);
+             GridLocalCacheEntry entry = peekExx(ctx.toCacheKeyObject(key));
  
              if (entry != null && ctx.isAll(entry, filter)) {
                  entry.releaseLocal();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index d84b0aa,f2648f0..b905781
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@@ -75,10 -73,17 +74,18 @@@ public class GridLocalAtomicCache<K, V
  
      /** {@inheritDoc} */
      @Override protected void init() {
-         map.setEntryFactory(new GridCacheMapEntryFactory<K, V>() {
-             @Override public GridCacheMapEntry<K, V> 
create(GridCacheContext<K, V> ctx, AffinityTopologyVersion topVer, K key, int 
hash,
-                 V val, @Nullable GridCacheMapEntry<K, V> next, long ttl, int 
hdrId) {
-                 return new GridLocalCacheEntry<K, V>(ctx, key, hash, val, 
next, ttl, hdrId);
+         map.setEntryFactory(new GridCacheMapEntryFactory() {
 -            @Override public GridCacheMapEntry create(GridCacheContext ctx,
 -                long topVer,
++            @Override public GridCacheMapEntry create(
++                GridCacheContext ctx,
++                AffinityTopologyVersion topVer,
+                 KeyCacheObject key,
+                 int hash,
+                 CacheObject val,
+                 @Nullable GridCacheMapEntry next,
+                 long ttl,
 -                int hdrId)
 -            {
++                int hdrId
++            ) {
+                 return new GridLocalCacheEntry(ctx, key, hash, val, next, 
ttl, hdrId);
              }
          });
      }
@@@ -1528,13 -1507,13 +1509,13 @@@
       *
       * @param locked Locked entries.
       */
-     private void unlockEntries(Iterable<GridCacheEntryEx<K, V>> locked) {
-         for (GridCacheEntryEx<K, V> entry : locked)
+     private void unlockEntries(Iterable<GridCacheEntryEx> locked) {
+         for (GridCacheEntryEx entry : locked)
              UNSAFE.monitorExit(entry);
  
 -        long topVer = ctx.affinity().affinityTopologyVersion();
 +        AffinityTopologyVersion topVer = 
ctx.affinity().affinityTopologyVersion();
  
-         for (GridCacheEntryEx<K, V> entry : locked)
+         for (GridCacheEntryEx entry : locked)
              ctx.evicts().touch(entry, topVer);
      }
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
index 6de9661,d063029..6e2e462
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
@@@ -29,9 -29,9 +29,8 @@@ import org.apache.ignite.lang.*
  import org.apache.ignite.plugin.security.*;
  import org.jetbrains.annotations.*;
  
- import javax.cache.*;
  import java.util.*;
  
 -import static org.apache.ignite.cache.CacheDistributionMode.*;
  import static 
org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.*;
  
  /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index bfbced7,1cd549a..0e2e63c
--- 
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
@@@ -209,20 -209,19 +209,18 @@@ class CacheContinuousQueryHandler<K, V
                          try {
                              ClusterNode node = ctx.discovery().node(nodeId);
  
-                             if (node != null) {
-                                 if (ctx.config().isPeerClassLoadingEnabled()) 
{
-                                     
evt.entry().p2pMarshal(ctx.config().getMarshaller());
 -                            if (ctx.config().isPeerClassLoadingEnabled() && 
node != null &&
 -                                U.hasCache(node, cacheName)) {
++                            if (ctx.config().isPeerClassLoadingEnabled() && 
node != null) {
+                                 evt.entry().prepareMarshal(cctx);
  
-                                     evt.entry().cacheName(cacheName);
+                                 GridCacheDeploymentManager depMgr =
+                                     
ctx.cache().internalCache(cacheName).context().deploy();
  
-                                     GridCacheDeploymentManager depMgr =
-                                         
ctx.cache().internalCache(cacheName).context().deploy();
- 
-                                     depMgr.prepare(evt.entry());
-                                 }
- 
-                                 ctx.continuous().addNotification(nodeId, 
routineId, evt, topic, sync);
+                                 depMgr.prepare(evt.entry());
                              }
+                             else
+                                 evt.entry().prepareMarshal(cctx);
+ 
+                             ctx.continuous().addNotification(nodeId, 
routineId, evt.entry(), topic, sync, true);
                          }
                          catch (IgniteCheckedException ex) {
                              U.error(ctx.log(getClass()), "Failed to send 
event notification to node: " + nodeId, ex);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index 6d16a5c,0d76c27..15402ce
--- 
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
@@@ -152,10 -155,10 +155,10 @@@ public class CacheContinuousQueryManage
  
          boolean initialized = false;
  
 -        boolean primary = cctx.affinity().primary(cctx.localNode(), key, -1);
 +        boolean primary = cctx.affinity().primary(cctx.localNode(), key, 
AffinityTopologyVersion.NONE);
          boolean recordIgniteEvt = !internal && 
cctx.gridEvents().isRecordable(EVT_CACHE_QUERY_OBJECT_READ);
  
-         for (CacheContinuousQueryListener<K, V> lsnr : lsnrCol.values()) {
+         for (CacheContinuousQueryListener lsnr : lsnrCol.values()) {
              if (preload && !lsnr.notifyExisting())
                  continue;
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 9764c29,0d23d8d..3993527
--- 
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
@@@ -362,7 -376,7 +377,11 @@@ public abstract class IgniteTxAdapter e
       *
       * @return Flag indicating whether near cache should be updated.
       */
-     protected boolean updateNearCache(GridCacheContext<K, V> cacheCtx, K key, 
AffinityTopologyVersion topVer) {
 -    protected boolean updateNearCache(GridCacheContext<?, ?> cacheCtx, 
KeyCacheObject key, long topVer) {
++    protected boolean updateNearCache(
++        GridCacheContext<?, ?> cacheCtx, 
++        KeyCacheObject key, 
++        AffinityTopologyVersion topVer
++    ) {
          return false;
      }
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index ac50450,d2f99df..5690aab
--- 
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
@@@ -18,9 -18,9 +18,10 @@@
  package org.apache.ignite.internal.processors.cache.transactions;
  
  import org.apache.ignite.*;
- import org.apache.ignite.internal.*;
  import org.apache.ignite.cluster.*;
 +import org.apache.ignite.internal.processors.affinity.*;
+ import org.apache.ignite.internal.*;
+ import org.apache.ignite.internal.managers.communication.*;
  import org.apache.ignite.internal.processors.cache.*;
  import org.apache.ignite.internal.processors.cache.distributed.near.*;
  import org.apache.ignite.internal.processors.cache.dr.*;
@@@ -468,7 -477,7 +478,7 @@@ public abstract class IgniteTxLocalAdap
       * @param topVer Topology version.
       * @return Cache entry.
       */
-     protected GridCacheEntryEx<K, V> entryEx(GridCacheContext<K, V> cacheCtx, 
IgniteTxKey<K> key, AffinityTopologyVersion topVer) {
 -    protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey 
key, long topVer) {
++    protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey 
key, AffinityTopologyVersion topVer) {
          return cacheCtx.cache().entryEx(key.key(), topVer);
      }
  
@@@ -1137,9 -1140,9 +1141,9 @@@
  
          boolean single = keysCnt == 1;
  
-         Collection<K> lockKeys = null;
+         Collection<KeyCacheObject> lockKeys = null;
  
 -        long topVer = topologyVersion();
 +        AffinityTopologyVersion topVer = topologyVersion();
  
          // In this loop we cover only read-committed or optimistic 
transactions.
          // Transactions that are pessimistic and not read-committed are 
covered

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index eebc4bd,8b2ab3e..553ec95
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@@ -20,8 -20,8 +20,9 @@@ package org.apache.ignite.internal.proc
  import org.apache.ignite.*;
  import org.apache.ignite.events.*;
  import org.apache.ignite.internal.*;
+ import org.apache.ignite.internal.managers.communication.*;
  import org.apache.ignite.internal.managers.eventstorage.*;
 +import org.apache.ignite.internal.processors.affinity.*;
  import org.apache.ignite.internal.processors.cache.*;
  import org.apache.ignite.internal.processors.cache.distributed.*;
  import org.apache.ignite.internal.processors.cache.distributed.dht.*;
@@@ -497,9 -507,9 +508,9 @@@ public class IgniteTxManager extends Gr
       * @param topVer Topology version.
       * @return Future that will be completed when all ongoing transactions 
are finished.
       */
 -    public IgniteInternalFuture<Boolean> finishTxs(long topVer) {
 +    public IgniteInternalFuture<Boolean> finishTxs(AffinityTopologyVersion 
topVer) {
          GridCompoundFuture<IgniteInternalTx, Boolean> res =
-             new GridCompoundFuture<>(context().kernalContext(),
+             new GridCompoundFuture<>(
                  new IgniteReducer<IgniteInternalTx, Boolean>() {
                      @Override public boolean collect(IgniteInternalTx e) {
                          return true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
index 2ed89b5,12d3e35..ad1937f
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
@@@ -1412,9 -1353,9 +1353,9 @@@ public class IgniteDataLoaderImpl<K, V
              if (internalCache.isNear())
                  internalCache = internalCache.context().near().dht();
  
-             GridCacheContext<K, V> cctx = internalCache.context();
+             GridCacheContext cctx = internalCache.context();
  
 -            long topVer = cctx.affinity().affinityTopologyVersion();
 +            AffinityTopologyVersion topVer = 
cctx.affinity().affinityTopologyVersion();
  
              GridCacheVersion ver = cctx.versions().next(topVer);
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 5ff11f2,f25229d..364ac38
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@@ -3822,8 -3766,8 +3821,8 @@@ public abstract class GridCacheAbstract
                  int size = 0;
  
                  for (String key : keys) {
 -                    if (ctx.affinity().localNode(key, 
ctx.discovery().topologyVersion())) {
 +                    if (ctx.affinity().localNode(key, new 
AffinityTopologyVersion(ctx.discovery().topologyVersion()))) {
-                         GridCacheEntryEx<String, Integer> e =
+                         GridCacheEntryEx e =
                              ctx.isNear() ? ctx.near().dht().peekEx(key) : 
ctx.cache().peekEx(key);
  
                          assert e != null : "Entry is null [idx=" + i + ", 
key=" + key + ", ctx=" + ctx + ']';

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
index 491bf52,f310f30..302d070
--- 
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
@@@ -101,9 -102,8 +101,8 @@@ public class GridCacheDeploymentSelfTes
          cfg.setCacheMode(PARTITIONED);
          cfg.setWriteSynchronizationMode(FULL_SYNC);
          cfg.setPreloadMode(SYNC);
-         cfg.setStoreValueBytes(true);
          cfg.setAtomicityMode(TRANSACTIONAL);
 -        cfg.setDistributionMode(NEAR_PARTITIONED);
 +        cfg.setNearConfiguration(new NearCacheConfiguration());
          cfg.setBackups(1);
  
          return cfg;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheExAbstractFullApiSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
index 112920d,e769816..027a48f
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
@@@ -132,10 -132,9 +132,10 @@@ public class GridCacheFinishPartitionsS
  
                  cache.get(key);
  
 -                IgniteInternalFuture<?> fut = 
grid.context().cache().context().partitionReleaseFuture(GRID_CNT + 1);
 +                IgniteInternalFuture<?> fut = 
grid.context().cache().context().partitionReleaseFuture(
 +                    new AffinityTopologyVersion(GRID_CNT + 1));
  
-                 fut.listenAsync(new CI1<IgniteInternalFuture<?>>() {
+                 fut.listen(new CI1<IgniteInternalFuture<?>>() {
                      @Override public void apply(IgniteInternalFuture<?> e) {
                          latch.countDown();
                      }
@@@ -197,11 -195,13 +197,13 @@@
  
              GridCacheAdapter<String, Integer> internal = grid.internalCache();
  
-             IgniteInternalFuture<?> nearFut = 
internal.context().mvcc().finishKeys(Collections.singletonList(key),
+             KeyCacheObject cacheKey = 
internal.context().toCacheKeyObject(key);
+ 
 -            IgniteInternalFuture<?> nearFut = 
internal.context().mvcc().finishKeys(
 -                Collections.singletonList(cacheKey), 2);
++            IgniteInternalFuture<?> nearFut = 
internal.context().mvcc().finishKeys(Collections.singletonList(cacheKey),
 +                new AffinityTopologyVersion(2));
  
              IgniteInternalFuture<?> dhtFut = 
internal.context().near().dht().context().mvcc().finishKeys(
-                 Collections.singletonList(key), new 
AffinityTopologyVersion(2));
 -                Collections.singletonList(cacheKey), 2);
++                Collections.singletonList(cacheKey), new 
AffinityTopologyVersion(2));
  
              assert !nearFut.isDone();
              assert !dhtFut.isDone();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLeakTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheObjectToStringSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
index 566c8fe,ad5ed0f..e747b53
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
@@@ -620,8 -620,7 +620,7 @@@ public class GridCachePutAllFailoverSel
  
              cacheCfg.setBackups(backups);
  
-             cacheCfg.setStoreValueBytes(true);
 -            cacheCfg.setDistributionMode(nearEnabled ? NEAR_PARTITIONED : 
PARTITIONED_ONLY);
 +            cacheCfg.setNearConfiguration(nearEnabled ? new 
NearCacheConfiguration() : null);
              cacheCfg.setQueryIndexEnabled(false);
  
              cacheCfg.setWriteSynchronizationMode(FULL_SYNC);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index 466c3e9,bd62b8d..2b23f2e
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@@ -435,13 -443,20 +444,20 @@@ public class GridCacheTestEntryEx exten
      }
  
      /** @inheritDoc */
-     @Override public GridCacheUpdateTxResult<V> innerSet(@Nullable 
IgniteInternalTx<K, V> tx, UUID evtNodeId,
-         UUID affNodeId, @Nullable V val, @Nullable byte[] valBytes, boolean 
writeThrough, boolean retval, long ttl,
-         boolean evt, boolean metrics, AffinityTopologyVersion topVer, 
IgnitePredicate<Cache.Entry<K, V>>[] filter,
-         GridDrType drType, long drExpireTime, @Nullable GridCacheVersion 
drVer, UUID subjId, String taskName)
-         throws IgniteCheckedException,
+     @Override public GridCacheUpdateTxResult innerSet(@Nullable 
IgniteInternalTx tx,
+         UUID evtNodeId,
+         UUID affNodeId,
+         @Nullable CacheObject val,
+         boolean writeThrough,
+         boolean retval,
+         long ttl,
+         boolean evt,
+         boolean metrics,
 -        long topVer,
++        AffinityTopologyVersion topVer,
+         CacheEntryPredicate[] filter, GridDrType drType,
+         long drExpireTime, @Nullable GridCacheVersion drVer, UUID subjId, 
String taskName) throws IgniteCheckedException,
          GridCacheEntryRemovedException {
-         return new GridCacheUpdateTxResult<>(true, rawPut(val, ttl));
+         return new GridCacheUpdateTxResult(true, rawPut(val, ttl));
      }
  
      /** {@inheritDoc} */
@@@ -488,26 -503,29 +504,30 @@@
          UUID subjId,
          String taskName) throws IgniteCheckedException,
          GridCacheEntryRemovedException {
-         return new GridCacheUpdateAtomicResult<>(true,
-             rawPut((V)val, 0),
-             (V)val,
-             null,
-             0L,
-             0L,
-             null,
-             null,
-             true);
-     }
- 
-     /** @inheritDoc */
-     @Override public GridCacheUpdateTxResult<V> innerRemove(@Nullable 
IgniteInternalTx<K, V> tx, UUID evtNodeId,
-         UUID affNodeId, boolean writeThrough, boolean retval, boolean evt, 
boolean metrics,
-         AffinityTopologyVersion topVer, IgnitePredicate<Cache.Entry<K, V>>[] 
filter, GridDrType drType,
-         @Nullable GridCacheVersion drVer, UUID subjId, String taskName)
-         throws IgniteCheckedException, GridCacheEntryRemovedException {
+         assert false;
+ 
+         return null;
+     }
+ 
+     /** @inheritDoc */
 -    @Override public GridCacheUpdateTxResult innerRemove(@Nullable 
IgniteInternalTx tx,
++    @Override public GridCacheUpdateTxResult innerRemove(
++        @Nullable IgniteInternalTx tx,
+         UUID evtNodeId,
+         UUID affNodeId,
+         boolean writeThrough,
+         boolean retval,
+         boolean evt,
+         boolean metrics,
 -        long topVer,
++        AffinityTopologyVersion topVer,
+         CacheEntryPredicate[] filter,
+         GridDrType drType,
+         @Nullable GridCacheVersion drVer,
+         UUID subjId,
 -        String taskName)
 -        throws IgniteCheckedException, GridCacheEntryRemovedException {
++        String taskName
++    ) throws IgniteCheckedException, GridCacheEntryRemovedException {
          obsoleteVer = ver;
  
-         V old = val;
+         CacheObject old = val;
  
          val = null;
  
@@@ -631,10 -634,18 +636,18 @@@
      }
  
      /** @inheritDoc */
-     @Override public boolean initialValue(V val, @Nullable byte[] valBytes, 
GridCacheVersion ver, long ttl,
-         long expireTime, boolean preload, AffinityTopologyVersion topVer, 
GridDrType drType) throws IgniteCheckedException,
-         GridCacheEntryRemovedException {
-         assert false; return false;
 -    @Override public boolean initialValue(CacheObject val,
++    @Override public boolean initialValue(
++        CacheObject val,
+         GridCacheVersion ver,
+         long ttl,
+         long expireTime,
+         boolean preload,
 -        long topVer,
 -        GridDrType drType)
 -        throws IgniteCheckedException, GridCacheEntryRemovedException
 -    {
++        AffinityTopologyVersion topVer,
++        GridDrType drType
++    ) throws IgniteCheckedException, GridCacheEntryRemovedException {
+         assert false;
+ 
+         return false;
      }
  
      /** @inheritDoc */
@@@ -837,10 -849,10 +851,10 @@@
      }
  
      /** {@inheritDoc} */
-     @Nullable @Override public V peek(boolean heap,
+     @Nullable @Override public CacheObject peek(boolean heap,
          boolean offheap,
          boolean swap,
 -        long topVer,
 +        AffinityTopologyVersion topVer,
          @Nullable IgniteCacheExpiryPolicy plc)
      {
          return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueBytesPreloadingSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueBytesPreloadingSelfTest.java
index 9ea9070,8f71235..c08d3ae
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueBytesPreloadingSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueBytesPreloadingSelfTest.java
@@@ -54,8 -56,7 +55,7 @@@ public class GridCacheValueBytesPreload
          ccfg.setCacheMode(PARTITIONED);
          ccfg.setBackups(1);
          ccfg.setAtomicityMode(ATOMIC);
 -        ccfg.setDistributionMode(PARTITIONED_ONLY);
 +        ccfg.setNearConfiguration(null);
-         ccfg.setStoreValueBytes(true);
          ccfg.setWriteSynchronizationMode(FULL_SYNC);
          ccfg.setMemoryMode(memMode);
          ccfg.setOffHeapMaxMemory(1024 * 1024 * 1024);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgnitePutAllLargeBatchSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgnitePutAllUpdateNonPreloadedPartitionSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
index 87fa0c0,ecfa7f6..bf77732
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
@@@ -358,8 -357,7 +358,8 @@@ public abstract class GridCacheAbstract
  
          for (int i = 0; i < gridCount(); i++) {
              for (GridCacheEntryEx e : 
((IgniteKernal)grid(i)).context().cache().internalCache(cctx.name()).map().allEntries0())
 {
 -                if (aff.primary(grid(i).localNode(), e.key(), -1) && 
e.key().value(cctx.cacheObjectContext(), false) instanceof 
GridCacheQueueHeaderKey)
 +                if (aff.primary(grid(i).localNode(), e.key(), 
AffinityTopologyVersion.NONE)
-                     && e.key() instanceof GridCacheQueueHeaderKey)
++                    && e.key().value(cctx.cacheObjectContext(), false) 
instanceof GridCacheQueueHeaderKey)
                      return i;
              }
          }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheLockAbstractTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedReloadAllAbstractSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
index 8be08de,2efdd7e..cdb29d2
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
@@@ -65,12 -64,16 +65,16 @@@ public class GridCacheDhtTestUtils 
              throw new IgniteCheckedException("Failed to get cache map.", e);
          }
  
-         GridDhtPartitionTopology<Integer,String> top = dht.topology();
+         GridDhtPartitionTopology top = dht.topology();
+ 
+         GridCacheContext ctx = dht.context();
  
          for (int i = 0; i < keyCnt; i++) {
-             cacheMap.putEntry(AffinityTopologyVersion.NONE, i, "value" + i, 
0);
+             KeyCacheObject cacheKey = ctx.toCacheKeyObject(i);
++            
++            cacheMap.putEntry(AffinityTopologyVersion.NONE, cacheKey, 
ctx.toCacheKeyObject("value" + i), 0);
  
-             dht.preloader().request(Collections.singleton(i), 
AffinityTopologyVersion.NONE);
 -            cacheMap.putEntry(-1, cacheKey, ctx.toCacheObject("value" + i), 
0);
 -
 -            dht.preloader().request(Collections.singleton(cacheKey), -1);
++            dht.preloader().request(Collections.singleton(cacheKey), 
AffinityTopologyVersion.NONE);
  
              GridDhtLocalPartition part = top.localPartition(aff.partition(i), 
false);
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPreloadSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
index aaa43d2,08b913c..51732df
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
@@@ -668,9 -668,9 +668,9 @@@ public class GridCacheNearMultiNodeSelf
          lock.lock();
  
          try {
 -            long topVer = grid(0).cluster().topologyVersion();
 +            AffinityTopologyVersion topVer = new 
AffinityTopologyVersion(grid(0).cluster().topologyVersion());
  
-             GridNearCacheEntry<Integer, String> nearEntry1 = nearEntry(0, 
key);
+             GridNearCacheEntry nearEntry1 = nearEntry(0, key);
  
              info("Peeked entry after lock [hash=" + hash(nearEntry1) + ", 
nearEntry=" + nearEntry1 + ']');
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
index 3d04893,90c37e0..cc7ff82
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
@@@ -22,7 -22,7 +22,8 @@@ import org.apache.ignite.cache.*
  import org.apache.ignite.cluster.*;
  import org.apache.ignite.configuration.*;
  import org.apache.ignite.internal.*;
 +import org.apache.ignite.internal.processors.affinity.*;
+ import org.apache.ignite.internal.processors.cache.*;
  import org.apache.ignite.internal.processors.cache.distributed.*;
  import org.apache.ignite.internal.processors.cache.distributed.dht.*;
  import org.apache.ignite.internal.util.typedef.*;
@@@ -217,8 -216,12 +218,12 @@@ public class GridCacheNearReadersSelfTe
  
          awaitPartitionMapExchange();
  
-         
((IgniteKernal)g1).internalCache(null).preloader().request(F.asList(1, 2), new 
AffinityTopologyVersion(2)).get();
-         
((IgniteKernal)g2).internalCache(null).preloader().request(F.asList(1, 2), new 
AffinityTopologyVersion(2)).get();
+         GridCacheContext ctx = ((IgniteKernal) 
g1).internalCache(null).context();
+ 
+         List<KeyCacheObject> cacheKeys = F.asList(ctx.toCacheKeyObject(1), 
ctx.toCacheKeyObject(2));
+ 
 -        ((IgniteKernal)g1).internalCache(null).preloader().request(cacheKeys, 
2).get();
 -        ((IgniteKernal)g2).internalCache(null).preloader().request(cacheKeys, 
2).get();
++        ((IgniteKernal)g1).internalCache(null).preloader().request(cacheKeys, 
new AffinityTopologyVersion(2)).get();
++        ((IgniteKernal)g2).internalCache(null).preloader().request(cacheKeys, 
new AffinityTopologyVersion(2)).get();
  
          IgniteCache<Integer, String> cache1 = g1.jcache(null);
          IgniteCache<Integer, String> cache2 = g2.jcache(null);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
index 4b74816,05f4338..d748f24
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
@@@ -244,10 -243,10 +244,10 @@@ public class GridCachePartitionedTxSalv
  
          IgniteKernal kernal = (IgniteKernal) ignite;
  
-         GridCacheAffinityManager<Object, Object> affMgr = 
kernal.internalCache().context().affinity();
+         GridCacheAffinityManager affMgr = 
kernal.internalCache().context().affinity();
  
          for (int i = 0; i < KEY_CNT * GRID_CNT * 1.5; i++) {
 -            if (!affMgr.localNode((Object)i, 
kernal.context().discovery().topologyVersion())) {
 +            if (!affMgr.localNode((Object)i, new 
AffinityTopologyVersion(kernal.context().discovery().topologyVersion()))) {
                  keys.add(i);
  
                  if (keys.size() == KEY_CNT)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
index 80f4afb,4b5a260..3245090
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
@@@ -33,10 -34,11 +33,11 @@@ public class GridCacheReplicatedFullApi
      }
  
      /** {@inheritDoc} */
 -    @Override protected CacheDistributionMode distributionMode() {
 -        return PARTITIONED_ONLY;
 +    @Override protected NearCacheConfiguration nearConfiguration() {
 +        return null;
      }
  
+     /** {@inheritDoc} */
      @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
          IgniteConfiguration c = super.getConfiguration(gridName);
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/dataload/GridDataLoaderPerformanceTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/dataload/GridDataLoaderProcessorSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
index 43d282d,459043e..826617d
--- 
a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
@@@ -47,19 -47,17 +47,18 @@@ public class GridCacheTestContext<K, V
              ctx,
              new GridCacheSharedContext<>(
                  ctx,
-                 new IgniteTxManager<K, V>(),
-                 new GridCacheVersionManager<K, V>(),
-                 new GridCacheMvccManager<K, V>(),
+                 new IgniteTxManager(),
+                 new GridCacheVersionManager(),
+                 new GridCacheMvccManager(),
                  new GridCacheDeploymentManager<K, V>(),
                  new GridCachePartitionExchangeManager<K, V>(),
-                 new GridCacheIoManager<K, V>()
+                 new GridCacheIoManager()
              ),
              defaultCacheConfiguration(),
 +            true,
-             new GridCacheEventManager<K, V>(),
-             new GridCacheSwapManager<K, V>(false),
-             new IgniteCacheOsSerializationManager<K, V>(),
-             new GridCacheStoreManager<K, V>(null,
+             new GridCacheEventManager(),
+             new GridCacheSwapManager(false),
+             new GridCacheStoreManager(null,
                  new IdentityHashMap<CacheStore, ThreadLocal>(),
                  null,
                  new CacheConfiguration()),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00f5d4ee/modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesNode.java
----------------------------------------------------------------------
diff --cc 
modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesNode.java
index 85cd58c,d813698..4a29e2f
--- 
a/modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesNode.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesNode.java
@@@ -112,16 -114,13 +112,14 @@@ public class GridCacheStoreValueBytesNo
  
          cacheCfg.setCacheMode(PARTITIONED);
  
-         cacheCfg.setStoreValueBytes(storeValBytes);
- 
          cacheCfg.setBackups(1);
  
 -        if (nearOnly) {
 -            cacheCfg.setNearEvictionPolicy(new 
GridCacheAlwaysEvictionPolicy());
 -
 -            cacheCfg.setDistributionMode(NEAR_ONLY);
 -        }
 +        // TODO IGNITE-45.
 +//        if (nearOnly) {
 +//            cacheCfg.setNearEvictionPolicy(new 
GridCacheAlwaysEvictionPolicy());
 +//
 +//            cacheCfg.setDistributionMode(NEAR_ONLY);
 +//        }
  
          cfg.setCacheConfiguration(cacheCfg);
  

Reply via email to