You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/09/26 09:43:16 UTC
[12/14] ignite git commit: Removed unused internal getTopologySafe
method.
Removed unused internal getTopologySafe method.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/aefa9a8a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/aefa9a8a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/aefa9a8a
Branch: refs/heads/ignite-3478
Commit: aefa9a8a7c8e90ed0a285a2d4e0d3c223860e40d
Parents: 357f603
Author: sboikov <sb...@gridgain.com>
Authored: Tue Sep 26 12:39:28 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Sep 26 12:39:28 2017 +0300
----------------------------------------------------------------------
.../cache/GatewayProtectedCacheProxy.java | 5 -
.../processors/cache/GridCacheAdapter.java | 73 ++----
.../processors/cache/GridCacheProxyImpl.java | 12 -
.../processors/cache/IgniteCacheProxy.java | 8 -
.../processors/cache/IgniteCacheProxyImpl.java | 16 --
.../processors/cache/IgniteInternalCache.java | 9 -
.../dht/CacheDistributedGetFutureAdapter.java | 5 +-
.../distributed/dht/GridDhtCacheAdapter.java | 5 -
.../cache/distributed/dht/GridDhtGetFuture.java | 2 -
.../distributed/dht/GridDhtGetSingleFuture.java | 2 -
.../dht/GridPartitionedGetFuture.java | 22 +-
.../dht/GridPartitionedSingleGetFuture.java | 5 +-
.../dht/atomic/GridDhtAtomicCache.java | 67 +-----
.../dht/colocated/GridDhtColocatedCache.java | 24 +-
.../distributed/near/GridNearAtomicCache.java | 2 -
.../distributed/near/GridNearCacheAdapter.java | 3 -
.../distributed/near/GridNearCacheEntry.java | 1 -
.../distributed/near/GridNearGetFuture.java | 3 -
.../near/GridNearTransactionalCache.java | 3 -
.../cache/distributed/near/GridNearTxLocal.java | 2 -
.../local/atomic/GridLocalAtomicCache.java | 2 -
.../IgniteCacheTopologySafeGetSelfTest.java | 222 -------------------
.../IgniteCacheFailoverTestSuite.java | 2 -
.../cache/hibernate/HibernateCacheProxy.java | 5 -
24 files changed, 31 insertions(+), 469 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java
index 5ba6810..37bf9bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java
@@ -1703,11 +1703,6 @@ public class GatewayProtectedCacheProxy<K, V> extends AsyncSupportAdapter<Ignite
}
/** {@inheritDoc} */
- @Override public V getTopologySafe(K key) {
- return delegate.getTopologySafe(key);
- }
-
- /** {@inheritDoc} */
@Override public IgniteCache<K, V> withAsync() {
return delegate.withAsync();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index c7e40ec..6d9f0d3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -629,9 +629,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/*subj id*/null,
/*task name*/null,
/*deserialize binary*/false,
- /*skip values*/
- /*can remap*/true,
- true,
+ /*skip values*/true,
false);
}
@@ -659,10 +657,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/*task name*/null,
/*deserialize binary*/false,
opCtx != null && opCtx.recovery(),
- /*skip values*/
- /*can remap*/true,
- true,
- false).chain(new CX1<IgniteInternalFuture<Map<K, V>>, Boolean>() {
+ /*skip values*/true,
+ /*need ver*/false).chain(new CX1<IgniteInternalFuture<Map<K, V>>, Boolean>() {
@Override public Boolean applyx(IgniteInternalFuture<Map<K, V>> fut) throws IgniteCheckedException {
Map<K, V> kvMap = fut.get();
@@ -1267,10 +1263,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
taskName,
/*deserialize cache objects*/true,
opCtx != null && opCtx.recovery(),
- /*skip values*/
- /*can remap*/false,
- true,
- false).get().get(key);
+ /*skip values*/false,
+ /*need ver*/false).get().get(key);
}
/** {@inheritDoc} */
@@ -1287,9 +1281,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
taskName,
true,
opCtx != null && opCtx.recovery(),
- /*can remap*/false,
- true,
- false).chain(new CX1<IgniteInternalFuture<Map<K, V>>, V>() {
+ /*skip vals*/false,
+ /*can remap*/false).chain(new CX1<IgniteInternalFuture<Map<K, V>>, V>() {
@Override public V applyx(IgniteInternalFuture<Map<K, V>> e) throws IgniteCheckedException {
return e.get().get(key);
}
@@ -1297,26 +1290,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public final V getTopologySafe(K key) throws IgniteCheckedException {
- String taskName = ctx.kernalContext().job().currentTaskName();
-
- CacheOperationContext opCtx = ctx.operationContextPerCall();
-
- return getAllAsync(
- F.asList(key),
- /*force primary*/false,
- /*skip tx*/false,
- /*subject id*/null,
- taskName,
- /*deserialize cache objects*/true,
- opCtx != null && opCtx.recovery(),
- /*skip values*/
- /*can remap*/false,
- false,
- false).get().get(key);
- }
-
- /** {@inheritDoc} */
@Nullable @Override public final Map<K, V> getAllOutTx(Set<? extends K> keys) throws IgniteCheckedException {
return getAllOutTxAsync(keys).get();
}
@@ -1334,9 +1307,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
taskName,
!(opCtx != null && opCtx.isKeepBinary()),
opCtx != null && opCtx.recovery(),
- /*skip values*/
- /*can remap*/false,
- true, false);
+ /*skip values*/false,
+ /*need ver*/false);
}
/** {@inheritDoc} */
@@ -1543,7 +1515,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
!(opCtx != null && opCtx.isKeepBinary()),
opCtx != null && opCtx.recovery(),
/*skip vals*/false,
- /*can remap*/true,
/*need ver*/false);
if (ctx.config().getInterceptor() != null)
@@ -1582,7 +1553,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
!(opCtx != null && opCtx.isKeepBinary()),
opCtx != null && opCtx.recovery(),
/*skip vals*/false,
- /*can remap*/true,
/*need ver*/true));
final boolean intercept = ctx.config().getInterceptor() != null;
@@ -1705,7 +1675,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @param taskName Task name.
* @param deserializeBinary Deserialize binary.
* @param skipVals Skip values.
- * @param canRemap Can remap flag.
* @param needVer Need version.
* @return Future for the get operation.
*/
@@ -1717,7 +1686,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
String taskName,
boolean deserializeBinary,
final boolean skipVals,
- boolean canRemap,
final boolean needVer
) {
CacheOperationContext opCtx = ctx.operationContextPerCall();
@@ -1730,7 +1698,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
deserializeBinary,
opCtx != null && opCtx.recovery(),
skipVals,
- canRemap,
needVer).chain(
new CX1<IgniteInternalFuture<Map<K, V>>, V>() {
@Override public V applyx(IgniteInternalFuture<Map<K, V>> e) throws IgniteCheckedException {
@@ -1758,7 +1725,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @param deserializeBinary Deserialize binary.
* @param recovery Recovery mode flag.
* @param skipVals Skip values.
- * @param canRemap Can remap flag.
* @param needVer Need version.
* @return Future for the get operation.
* @see GridCacheAdapter#getAllAsync(Collection)
@@ -1772,7 +1738,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
boolean deserializeBinary,
boolean recovery,
boolean skipVals,
- boolean canRemap,
final boolean needVer
) {
CacheOperationContext opCtx = ctx.operationContextPerCall();
@@ -1790,7 +1755,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
forcePrimary,
skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null),
skipVals,
- canRemap,
needVer);
}
@@ -1806,7 +1770,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @param forcePrimary Froce primary.
* @param expiry Expiry policy.
* @param skipVals Skip values.
- * @param canRemap Can remap flag.
* @param needVer Need version.
* @return Future for the get operation.
* @see GridCacheAdapter#getAllAsync(Collection)
@@ -1822,7 +1785,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
final boolean forcePrimary,
@Nullable IgniteCacheExpiryPolicy expiry,
final boolean skipVals,
- boolean canRemap,
final boolean needVer
) {
ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -1841,7 +1803,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
skipVals,
/*keep cache objects*/false,
recovery,
- canRemap,
needVer);
}
@@ -1856,7 +1817,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @param expiry Expiry policy.
* @param skipVals Skip values flag.
* @param keepCacheObjects Keep cache objects.
- * @param canRemap Can remap flag.
* @param needVer If {@code true} returns values as tuples containing value and version.
* @return Future.
*/
@@ -1872,7 +1832,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
final boolean skipVals,
final boolean keepCacheObjects,
final boolean recovery,
- boolean canRemap,
final boolean needVer
) {
if (F.isEmpty(keys))
@@ -1894,9 +1853,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (tx == null || tx.implicit()) {
Map<KeyCacheObject, EntryGetResult> misses = null;
- final AffinityTopologyVersion topVer = tx == null ?
- (canRemap ?
- ctx.affinity().affinityTopologyVersion() : ctx.shared().exchange().readyAffinityVersion()) :
+ final AffinityTopologyVersion topVer = tx == null ? ctx.affinity().affinityTopologyVersion() :
tx.topologyVersion();
try {
@@ -4559,8 +4516,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
null,
taskName,
deserializeBinary,
- /*can remap*/false,
- true, needVer).get();
+ /*skip vals*/false,
+ needVer).get();
}
catch (IgniteException e) {
if (e.getCause(IgniteCheckedException.class) != null)
@@ -4592,8 +4549,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
null,
taskName,
deserializeBinary,
- /*can remap*/false,
- true, needVer);
+ /*skip vals*/false,
+ needVer);
}
/**
@@ -4619,7 +4576,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
deserializeBinary,
opCtx != null && opCtx.recovery(),
/*skip vals*/false,
- /*can remap*/true,
needVer).get();
}
@@ -4645,7 +4601,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
deserializeBinary,
recovery,
/*skip vals*/false,
- /*can remap*/true,
needVer);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index d81b9f7..30edbea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -346,18 +346,6 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
- @Override public V getTopologySafe(K key) throws IgniteCheckedException {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.getTopologySafe(key);
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
@Override public IgniteInternalFuture<V> getAsync(K key) {
CacheOperationContext prev = gate.enter(opCtx);
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 22bd676..361764e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -92,14 +92,6 @@ public interface IgniteCacheProxy<K, V> extends IgniteCache<K, V>, Externalizabl
public void closeProxy();
/**
- * Gets value without waiting for topology changes.
- *
- * @param key Key.
- * @return Value.
- */
- public V getTopologySafe(K key);
-
- /**
* @return Future that contains cache destroy operation.
*/
public IgniteFuture<?> destroyAsync();
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java
index 3056361..ae1c6f5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java
@@ -1726,22 +1726,6 @@ public class IgniteCacheProxyImpl<K, V> extends AsyncSupportAdapter<IgniteCache<
}
/**
- * Gets value without waiting for toplogy changes.
- *
- * @param key Key.
- * @return Value.
- */
- @Override
- public V getTopologySafe(K key) {
- try {
- return delegate.getTopologySafe(key);
- }
- catch (IgniteCheckedException | IgniteException e) {
- throw cacheException(e);
- }
- }
-
- /**
* Throws {@code IgniteCacheRestartingException} if proxy is restarting.
*/
public void checkRestart() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index 2f4a40e..d01d536 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -1810,15 +1810,6 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
public IgniteInternalFuture<?> localLoadCacheAsync(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object... args);
/**
- * Gets value without waiting for toplogy changes.
- *
- * @param key Key.
- * @return Value.
- * @throws IgniteCheckedException If failed.
- */
- public V getTopologySafe(K key) throws IgniteCheckedException;
-
- /**
* @param topVer Locked topology version.
* @param key Key.
* @param entryProcessor Entry processor.
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
index 679732b..2257c9f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
@@ -92,7 +92,7 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCacheCo
protected IgniteCacheExpiryPolicy expiryPlc;
/** Flag indicating that get should be done on a locked topology version. */
- protected boolean canRemap;
+ protected boolean canRemap = true;
/** */
protected final boolean needVer;
@@ -114,7 +114,6 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCacheCo
* @param deserializeBinary Deserialize binary flag.
* @param expiryPlc Expiry policy.
* @param skipVals Skip values flag.
- * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
* @param needVer If {@code true} returns values as tuples containing value and version.
* @param keepCacheObjects Keep cache objects flag.
*/
@@ -128,7 +127,6 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCacheCo
boolean deserializeBinary,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
- boolean canRemap,
boolean needVer,
boolean keepCacheObjects,
boolean recovery
@@ -146,7 +144,6 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCacheCo
this.deserializeBinary = deserializeBinary;
this.expiryPlc = expiryPlc;
this.skipVals = skipVals;
- this.canRemap = canRemap;
this.needVer = needVer;
this.keepCacheObjects = keepCacheObjects;
this.recovery = recovery;
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/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 1f67c1d..bbb2c5b 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
@@ -735,7 +735,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
boolean deserializeBinary,
boolean recovery,
boolean skipVals,
- boolean canRemap,
boolean needVer
) {
CacheOperationContext opCtx = ctx.operationContextPerCall();
@@ -751,7 +750,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
forcePrimary,
null,
skipVals,
- canRemap,
needVer);
}
@@ -763,7 +761,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
* @param taskName Task name.
* @param expiry Expiry policy.
* @param skipVals Skip values flag.
- * @param canRemap Can remap flag.
* @return Get future.
*/
IgniteInternalFuture<Map<KeyCacheObject, EntryGetResult>> getDhtAllAsync(
@@ -774,7 +771,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
String taskName,
@Nullable IgniteCacheExpiryPolicy expiry,
boolean skipVals,
- boolean canRemap,
boolean recovery
) {
return getAllAsync0(keys,
@@ -788,7 +784,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
skipVals,
/*keep cache objects*/true,
recovery,
- canRemap,
/*need version*/true);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
index 8430f84..4319374 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
@@ -422,7 +422,6 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
taskName,
expiryPlc,
skipVals,
- /*can remap*/true,
recovery);
}
else {
@@ -446,7 +445,6 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
taskName,
expiryPlc,
skipVals,
- /*can remap*/true,
recovery);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
index 439bb9d..7c6c020 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
@@ -365,7 +365,6 @@ public final class GridDhtGetSingleFuture<K, V> extends GridFutureAdapter<GridCa
taskName,
expiryPlc,
skipVals,
- /*can remap*/true,
recovery);
}
else {
@@ -391,7 +390,6 @@ public final class GridDhtGetSingleFuture<K, V> extends GridFutureAdapter<GridCa
taskName,
expiryPlc,
skipVals,
- /*can remap*/true,
recovery);
fut0.listen(createGetFutureListener());
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/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 e7e0e06..73c0ea5 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
@@ -73,29 +73,24 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
/** Logger. */
private static IgniteLogger log;
- /** Topology version. */
- private AffinityTopologyVersion topVer;
-
/**
* @param cctx Context.
* @param keys Keys.
- * @param topVer Topology version.
* @param readThrough Read through flag.
* @param forcePrimary If {@code true} then will force network trip to primary node even
* if called on backup node.
* @param subjId Subject ID.
* @param taskName Task name.
* @param deserializeBinary Deserialize binary flag.
+ * @param recovery Recovery mode flag.
* @param expiryPlc Expiry policy.
* @param skipVals Skip values flag.
- * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
* @param needVer If {@code true} returns values as tuples containing value and version.
* @param keepCacheObjects Keep cache objects flag.
*/
public GridPartitionedGetFuture(
GridCacheContext<K, V> cctx,
Collection<KeyCacheObject> keys,
- AffinityTopologyVersion topVer,
boolean readThrough,
boolean forcePrimary,
@Nullable UUID subjId,
@@ -104,7 +99,6 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
boolean recovery,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
- boolean canRemap,
boolean needVer,
boolean keepCacheObjects
) {
@@ -117,21 +111,20 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
deserializeBinary,
expiryPlc,
skipVals,
- canRemap,
needVer,
keepCacheObjects,
recovery);
- this.topVer = topVer;
-
if (log == null)
log = U.logger(cctx.kernalContext(), logRef, GridPartitionedGetFuture.class);
}
/**
* Initializes future.
+ *
+ * @param topVer Topology version.
*/
- public void init() {
+ public void init(AffinityTopologyVersion topVer) {
AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null);
if (lockedTopVer != null) {
@@ -140,7 +133,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), lockedTopVer);
}
else {
- AffinityTopologyVersion topVer = this.topVer.topologyVersion() > 0 ? this.topVer :
+ topVer = topVer.topologyVersion() > 0 ? topVer :
canRemap ? cctx.affinity().affinityTopologyVersion() : cctx.shared().exchange().readyAffinityVersion();
map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), topVer);
@@ -402,7 +395,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
boolean fastLocGet = (!forcePrimary || affNodes.get(0).isLocal()) &&
cctx.allowFastLocalRead(part, affNodes, topVer);
- if (fastLocGet && localGet(key, part, locVals))
+ if (fastLocGet && localGet(topVer, key, part, locVals))
return false;
ClusterNode node = affinityNode(affNodes);
@@ -438,12 +431,13 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
}
/**
+ * @param topVer Topology version.
* @param key Key.
* @param part Partition.
* @param locVals Local values.
* @return {@code True} if there is no need to further search value.
*/
- private boolean localGet(KeyCacheObject key, int part, Map<K, V> locVals) {
+ private boolean localGet(AffinityTopologyVersion topVer, KeyCacheObject key, int part, Map<K, V> locVals) {
assert cctx.affinityNode() : this;
GridDhtCacheAdapter<K, V> cache = cache();
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
index 0828a80..234ee91 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
@@ -133,7 +133,6 @@ public class GridPartitionedSingleGetFuture extends GridCacheFutureAdapter<Objec
* @param deserializeBinary Deserialize binary flag.
* @param expiryPlc Expiry policy.
* @param skipVals Skip values flag.
- * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
* @param needVer If {@code true} returns values as tuples containing value and version.
* @param keepCacheObjects Keep cache objects flag.
*/
@@ -148,7 +147,6 @@ public class GridPartitionedSingleGetFuture extends GridCacheFutureAdapter<Objec
boolean deserializeBinary,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
- boolean canRemap,
boolean needVer,
boolean keepCacheObjects,
boolean recovery
@@ -162,6 +160,8 @@ public class GridPartitionedSingleGetFuture extends GridCacheFutureAdapter<Objec
canRemap = false;
}
+ else
+ canRemap = true;
this.cctx = cctx;
this.key = key;
@@ -172,7 +172,6 @@ public class GridPartitionedSingleGetFuture extends GridCacheFutureAdapter<Objec
this.deserializeBinary = deserializeBinary;
this.expiryPlc = expiryPlc;
this.skipVals = skipVals;
- this.canRemap = canRemap;
this.needVer = needVer;
this.keepCacheObjects = keepCacheObjects;
this.recovery = recovery;
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/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 a50a707..30614a3 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
@@ -439,50 +439,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
return near;
}
- /**
- * @param key Key.
- * @param deserializeBinary Deserialize binary.
- * @param needVer Need version.
- * @return Value.
- * @throws IgniteCheckedException If failed.
- */
- @Nullable public V get0(K key, boolean deserializeBinary, boolean needVer) throws IgniteCheckedException {
- ctx.checkSecurity(SecurityPermission.CACHE_READ);
-
- if (keyCheck)
- validateCacheKey(key);
-
- String taskName = ctx.kernalContext().job().currentTaskName();
-
- CacheOperationContext opCtx = ctx.operationContextPerCall();
-
- UUID subjId = ctx.subjectIdPerCall(null, opCtx);
-
- final ExpiryPolicy expiryPlc = opCtx != null ? opCtx.expiry() : null;
-
- final boolean skipStore = opCtx != null && opCtx.skipStore();
-
- try {
- return getAsync0(ctx.toCacheKeyObject(key),
- !ctx.config().isReadFromBackup(),
- subjId,
- taskName,
- deserializeBinary,
- opCtx != null && opCtx.recovery(),
- expiryPlc,
- false,
- skipStore,
- true,
- needVer).get();
- }
- catch (IgniteException e) {
- if (e.getCause(IgniteCheckedException.class) != null)
- throw e.getCause(IgniteCheckedException.class);
- else
- throw e;
- }
- }
-
/** {@inheritDoc} */
@Override protected IgniteInternalFuture<V> getAsync(
final K key,
@@ -492,7 +448,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
final String taskName,
final boolean deserializeBinary,
final boolean skipVals,
- final boolean canRemap,
final boolean needVer
) {
ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -520,7 +475,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
expiryPlc,
skipVals,
skipStore,
- canRemap,
needVer);
}
});
@@ -538,7 +492,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
deserializeBinary,
opCtx != null && opCtx.recovery(),
false,
- true,
needVer,
false).get();
}
@@ -553,7 +506,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
final boolean deserializeBinary,
final boolean recovery,
final boolean skipVals,
- final boolean canRemap,
final boolean needVer
) {
return getAllAsyncInternal(keys,
@@ -563,7 +515,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
deserializeBinary,
recovery,
skipVals,
- canRemap,
needVer,
true);
}
@@ -575,7 +526,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
* @param taskName Task name.
* @param deserializeBinary Deserialize binary flag.
* @param skipVals Skip values flag.
- * @param canRemap Can remap flag.
* @param needVer Need version flag.
* @param asyncOp Async operation flag.
* @return Future.
@@ -588,7 +538,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
final boolean deserializeBinary,
final boolean recovery,
final boolean skipVals,
- final boolean canRemap,
final boolean needVer,
boolean asyncOp
) {
@@ -622,7 +571,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
expiryPlc,
skipVals,
skipStore,
- canRemap,
needVer);
}
});
@@ -637,7 +585,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
expiryPlc,
skipVals,
skipStore,
- canRemap,
needVer);
}
}
@@ -1409,7 +1356,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
* @param expiryPlc Expiry policy.
* @param skipVals Skip values flag.
* @param skipStore Skip store flag.
- * @param canRemap Can remap flag.
* @param needVer Need version.
* @return Get future.
*/
@@ -1422,11 +1368,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Nullable ExpiryPolicy expiryPlc,
boolean skipVals,
boolean skipStore,
- boolean canRemap,
boolean needVer
) {
- AffinityTopologyVersion topVer = canRemap ? ctx.affinity().affinityTopologyVersion() :
- ctx.shared().exchange().readyAffinityVersion();
+ AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
IgniteCacheExpiryPolicy expiry = skipVals ? null : expiryPolicy(expiryPlc);
@@ -1440,7 +1384,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
deserializeBinary,
expiry,
skipVals,
- canRemap,
needVer,
false,
recovery);
@@ -1473,11 +1416,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Nullable ExpiryPolicy expiryPlc,
boolean skipVals,
boolean skipStore,
- boolean canRemap,
boolean needVer
) {
- AffinityTopologyVersion topVer = canRemap ? ctx.affinity().affinityTopologyVersion() :
- ctx.shared().exchange().readyAffinityVersion();
+ AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
final IgniteCacheExpiryPolicy expiry = skipVals ? null : expiryPolicy(expiryPlc);
@@ -1640,7 +1581,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
// Either reload or not all values are available locally.
GridPartitionedGetFuture<K, V> fut = new GridPartitionedGetFuture<>(ctx,
keys,
- topVer,
!skipStore,
forcePrimary,
subjId,
@@ -1649,11 +1589,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
recovery,
expiry,
skipVals,
- canRemap,
needVer,
false);
- fut.init();
+ fut.init(topVer);
return fut;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/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 8449f3a..edb4278 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
@@ -179,7 +179,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
String taskName,
final boolean deserializeBinary,
final boolean skipVals,
- boolean canRemap,
final boolean needVer) {
ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -226,9 +225,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
}, opCtx, /*retry*/false);
}
- AffinityTopologyVersion topVer = tx == null ?
- (canRemap ? ctx.affinity().affinityTopologyVersion() : ctx.shared().exchange().readyAffinityVersion()) :
- tx.topologyVersion();
+ AffinityTopologyVersion topVer = tx == null ? ctx.affinity().affinityTopologyVersion() : tx.topologyVersion();
subjId = ctx.subjectIdPerCall(subjId, opCtx);
@@ -242,7 +239,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
deserializeBinary,
skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null),
skipVals,
- canRemap,
needVer,
/*keepCacheObjects*/false,
opCtx != null && opCtx.recovery());
@@ -262,7 +258,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
final boolean deserializeBinary,
final boolean recovery,
final boolean skipVals,
- boolean canRemap,
final boolean needVer
) {
ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -293,9 +288,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
}, opCtx, /*retry*/false);
}
- AffinityTopologyVersion topVer = tx == null ?
- (canRemap ? ctx.affinity().affinityTopologyVersion() : ctx.shared().exchange().readyAffinityVersion()) :
- tx.topologyVersion();
+ AffinityTopologyVersion topVer = tx == null ? ctx.affinity().affinityTopologyVersion() : tx.topologyVersion();
subjId = ctx.subjectIdPerCall(subjId, opCtx);
@@ -310,7 +303,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
recovery,
skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null),
skipVals,
- canRemap,
needVer);
}
@@ -324,7 +316,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
* @param deserializeBinary Deserialize binary flag.
* @param expiryPlc Expiry policy.
* @param skipVals Skip values flag.
- * @param canRemap Can remap flag.
* @param needVer Need version.
* @return Loaded values.
*/
@@ -339,7 +330,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
boolean recovery,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
- boolean canRemap,
boolean needVer) {
return loadAsync(keys,
readThrough,
@@ -350,7 +340,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
recovery,
expiryPlc,
skipVals,
- canRemap,
needVer,
false);
}
@@ -365,7 +354,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
* @param deserializeBinary Deserialize binary flag.
* @param expiryPlc Expiry policy.
* @param skipVals Skip values flag.
- * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
* @param needVer If {@code true} returns values as tuples containing value and version.
* @param keepCacheObj Keep cache objects flag.
* @return Load future.
@@ -380,7 +368,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
boolean deserializeBinary,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
- boolean canRemap,
boolean needVer,
boolean keepCacheObj,
boolean recovery
@@ -395,7 +382,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
deserializeBinary,
expiryPlc,
skipVals,
- canRemap,
needVer,
keepCacheObj,
recovery);
@@ -415,7 +401,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
* @param deserializeBinary Deserialize binary flag.
* @param expiryPlc Expiry policy.
* @param skipVals Skip values flag.
- * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
* @param needVer If {@code true} returns values as tuples containing value and version.
* @param keepCacheObj Keep cache objects flag.
* @return Load future.
@@ -431,7 +416,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
boolean recovery,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
- boolean canRemap,
boolean needVer,
boolean keepCacheObj
) {
@@ -607,7 +591,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
GridPartitionedGetFuture<K, V> fut = new GridPartitionedGetFuture<>(
ctx,
keys,
- topVer,
readThrough,
forcePrimary,
subjId,
@@ -616,11 +599,10 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
recovery,
expiryPlc,
skipVals,
- canRemap,
needVer,
keepCacheObj);
- fut.init();
+ fut.init(topVer);
return fut;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index e6c5c10..2f832b4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -405,7 +405,6 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
boolean deserializeBinary,
boolean recovery,
boolean skipVals,
- boolean canRemap,
boolean needVer
) {
ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -430,7 +429,6 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
skipVals ? null : opCtx != null ? opCtx.expiry() : null,
skipVals,
opCtx != null && opCtx.skipStore(),
- canRemap,
needVer);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 428355c..672693c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -216,7 +216,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
* @param expiryPlc Expiry policy.
* @param skipVal Skip value flag.
* @param skipStore Skip store flag.
- * @param canRemap Can remap flag.
* @param needVer Need version.
* @return Loaded values.
*/
@@ -231,7 +230,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
@Nullable ExpiryPolicy expiryPlc,
boolean skipVal,
boolean skipStore,
- boolean canRemap,
boolean needVer
) {
if (F.isEmpty(keys))
@@ -251,7 +249,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
deserializeBinary,
expiry,
skipVal,
- canRemap,
needVer,
false,
recovery);
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --git 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
index ce728b5..ea52766 100644
--- 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
@@ -331,7 +331,6 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
null,
false,
/*skip store*/false,
- /*can remap*/true,
false
).get().get(keyValue(false));
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/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 1ab56a4..807270d 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
@@ -93,7 +93,6 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
* @param deserializeBinary Deserialize binary flag.
* @param expiryPlc Expiry policy.
* @param skipVals Skip values flag.
- * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
* @param needVer If {@code true} returns values as tuples containing value and version.
* @param keepCacheObjects Keep cache objects flag.
*/
@@ -108,7 +107,6 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
boolean deserializeBinary,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
- boolean canRemap,
boolean needVer,
boolean keepCacheObjects,
boolean recovery
@@ -122,7 +120,6 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
deserializeBinary,
expiryPlc,
skipVals,
- canRemap,
needVer,
keepCacheObjects,
recovery);
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/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 a13da3d..0c5f43d 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
@@ -122,7 +122,6 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
final boolean deserializeBinary,
final boolean recovery,
final boolean skipVals,
- boolean canRemap,
final boolean needVer
) {
ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -167,7 +166,6 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
skipVals ? null : opCtx != null ? opCtx.expiry() : null,
skipVals,
skipStore,
- canRemap,
needVer);
}
@@ -202,7 +200,6 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
deserializeBinary,
expiryPlc,
skipVals,
- /*can remap*/true,
needVer,
/*keepCacheObjects*/true,
recovery);
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git 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
index 8b043d8..e73f34b 100644
--- 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
@@ -2513,7 +2513,6 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter implements GridTimeou
/*deserializeBinary*/false,
expiryPlc0,
skipVals,
- /*can remap*/true,
needVer,
/*keepCacheObject*/true,
recovery
@@ -2546,7 +2545,6 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter implements GridTimeou
recovery,
expiryPlc0,
skipVals,
- /*can remap*/true,
needVer,
/*keepCacheObject*/true
).chain(new C1<IgniteInternalFuture<Map<Object, Object>>, Void>() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git 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
index 1be264d..40d1fac 100644
--- 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
@@ -340,7 +340,6 @@ public class GridLocalAtomicCache<K, V> extends GridLocalCache<K, V> {
final boolean deserializeBinary,
boolean recovery,
final boolean skipVals,
- boolean canRemap,
final boolean needVer
) {
A.notNull(keys, "keys");
@@ -543,7 +542,6 @@ public class GridLocalAtomicCache<K, V> extends GridLocalCache<K, V> {
/*force primary*/false,
expiry,
skipVals,
- /*can remap*/true,
needVer).get();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java
deleted file mode 100644
index 0140000..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java
+++ /dev/null
@@ -1,222 +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.internal.processors.cache;
-
-import java.util.Collection;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CountDownLatch;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.NearCacheConfiguration;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.U;
-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 org.apache.ignite.transactions.Transaction;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
-import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
-
-/**
- *
- */
-public class IgniteCacheTopologySafeGetSelfTest extends GridCommonAbstractTest {
- /** Number of initial grids. */
- public static final int GRID_CNT = 4;
-
- /** */
- private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
- /** TX commit latch. */
- private CountDownLatch releaseLatch;
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
- cfg.setCacheConfiguration(
- cacheCfg("tx", TRANSACTIONAL, false),
- cacheCfg("atomic", ATOMIC, false),
- cacheCfg("tx_near", TRANSACTIONAL, true),
- cacheCfg("atomic_near", ATOMIC, true));
-
- TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
- disco.setIpFinder(IP_FINDER);
-
- cfg.setDiscoverySpi(disco);
-
- return cfg;
- }
-
- /**
- * @param name Cache name.
- * @param cacheMode Cache mode.
- * @param near Near enabled flag.
- * @return Cache configuration.
- */
- @SuppressWarnings("unchecked")
- private CacheConfiguration cacheCfg(String name, CacheAtomicityMode cacheMode, boolean near) {
- CacheConfiguration cfg = new CacheConfiguration(name);
-
- cfg.setAtomicityMode(cacheMode);
- cfg.setBackups(1);
-
- if (near)
- cfg.setNearConfiguration(new NearCacheConfiguration());
- else
- cfg.setNearConfiguration(null);
-
- return cfg;
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testGetTopologySafeNodeJoin() throws Exception {
- checkGetTopologySafeNodeJoin(false);
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testGetTopologySafeNodeJoinPrimaryLeave() throws Exception {
- checkGetTopologySafeNodeJoin(true);
- }
-
- /**
- * @throws Exception If failed.
- */
- public void checkGetTopologySafeNodeJoin(boolean failPrimary) throws Exception {
- startGrids(GRID_CNT);
-
- awaitPartitionMapExchange();
-
- try {
- ClusterNode targetNode = ignite(1).cluster().localNode();
-
- info(">>> Target node: " + targetNode.id());
-
- // Populate caches with a key that does not belong to ignite(0).
- int key = -1;
- for (int i = 0; i < 100; i++) {
- Collection<ClusterNode> nodes = ignite(0).affinity("tx").mapKeyToPrimaryAndBackups(i);
- ClusterNode primaryNode = F.first(nodes);
-
- if (!nodes.contains(ignite(0).cluster().localNode()) && primaryNode.id().equals(targetNode.id())) {
- ignite(1).cache("tx").put(i, i);
- ignite(1).cache("atomic").put(i, i);
- ignite(1).cache("tx_near").put(i, i);
- ignite(1).cache("atomic_near").put(i, i);
-
- key = i;
-
-
- break;
- }
- }
-
- assertTrue(key != -1);
-
- IgniteInternalFuture<?> txFut = startBlockingTxAsync();
-
- IgniteInternalFuture<?> nodeFut = startNodeAsync();
-
- if (failPrimary)
- stopGrid(getTestIgniteInstanceName(1), false, false);
-
- assertEquals(key, ((IgniteKernal)ignite(0)).internalCache("tx").getTopologySafe(key));
- assertEquals(key, ((IgniteKernal)ignite(0)).internalCache("atomic").getTopologySafe(key));
- assertEquals(key, ((IgniteKernal)ignite(0)).internalCache("tx_near").getTopologySafe(key));
- assertEquals(key, ((IgniteKernal)ignite(0)).internalCache("atomic_near").getTopologySafe(key));
-
- releaseTx();
-
- txFut.get();
- nodeFut.get();
- }
- finally {
- stopAllGrids();
- }
- }
-
- /**
- * @return Future.
- * @throws Exception If failed.
- */
- private IgniteInternalFuture<?> startNodeAsync() throws Exception {
- IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
- @Override public Object call() throws Exception {
- startGrid(GRID_CNT);
-
- return null;
- }
- });
-
- U.sleep(1000);
-
- return fut;
- }
-
- /**
- * @return TX release future.
- * @throws Exception If failed.
- */
- private IgniteInternalFuture<?> startBlockingTxAsync() throws Exception {
- final CountDownLatch lockLatch = new CountDownLatch(1);
-
- IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
- @Override public Object call() throws Exception {
- try (Transaction ignore = ignite(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- for (int i = 0; i < 30; i++)
- ignite(0).cache("tx").get("value-" + i);
-
- releaseLatch = new CountDownLatch(1);
-
- lockLatch.countDown();
-
- releaseLatch.await();
- }
-
- return null;
- }
- });
-
- lockLatch.await();
-
- return fut;
- }
-
- /**
- *
- */
- private void releaseTx() {
- assert releaseLatch != null;
-
- releaseLatch.countDown();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index 34eb295..7357d7e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -20,7 +20,6 @@ package org.apache.ignite.testsuites;
import java.util.Set;
import junit.framework.TestSuite;
import org.apache.ignite.internal.processors.cache.GridCacheIncrementTransformTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheTopologySafeGetSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheAtomicNodeJoinTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheSizeFailoverTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheTxNearDisabledPutGetRestartTest;
@@ -83,7 +82,6 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheSizeFailoverTest.class);
- suite.addTestSuite(IgniteCacheTopologySafeGetSelfTest.class);
suite.addTestSuite(IgniteAtomicLongChangingTopologySelfTest.class);
suite.addTestSuite(GridCacheTxNodeFailureSelfTest.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/aefa9a8a/modules/hibernate-core/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/hibernate-core/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java b/modules/hibernate-core/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
index aa1f83b..0fc2c2d 100644
--- a/modules/hibernate-core/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
+++ b/modules/hibernate-core/src/main/java/org/apache/ignite/cache/hibernate/HibernateCacheProxy.java
@@ -648,11 +648,6 @@ public class HibernateCacheProxy implements IgniteInternalCache<Object, Object>
}
/** {@inheritDoc} */
- @Override public Object getTopologySafe(Object key) throws IgniteCheckedException {
- return delegate.getTopologySafe(keyTransformer.transform(key));
- }
-
- /** {@inheritDoc} */
@Override public Collection<Integer> lostPartitions() {
return delegate.lostPartitions();
}