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 2016/12/05 14:41:40 UTC
[18/50] [abbrv] ignite git commit: fixing tc (removed benchmark
related backdoors)
fixing tc (removed benchmark related backdoors)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fdbf90a7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fdbf90a7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fdbf90a7
Branch: refs/heads/ignite-comm-balance-master
Commit: fdbf90a7fe219d3cc7d3975966d65dfce3ff0e6d
Parents: a6a59fe
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Nov 11 17:00:37 2016 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Nov 11 17:00:37 2016 +0300
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheUtils.java | 15 ++++++++++++++-
.../internal/processors/cache/IgniteCacheProxy.java | 12 ------------
.../distributed/dht/atomic/GridDhtAtomicCache.java | 14 --------------
.../dht/atomic/GridNearAtomicUpdateFuture.java | 10 ++--------
4 files changed, 16 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdbf90a7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index a71b2e6..f4e8933 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -110,9 +110,12 @@ import static org.apache.ignite.internal.processors.cache.GridCacheOperation.REA
* Cache utility methods.
*/
public class GridCacheUtils {
- // TODO cheat cache ID.
+ /** Cheat cache ID for debugging and benchmarking purposes. */
public static final int cheatCacheId;
+ /*
+ *
+ */
static {
String cheatCache = System.getProperty("CHEAT_CACHE");
@@ -128,6 +131,16 @@ public class GridCacheUtils {
cheatCacheId = 0;
}
+ /**
+ * Quickly checks if passed in cache ID is a "cheat cache ID" set by -DCHEAT_CACHE=user_cache_name
+ * and resolved in static block above.
+ *
+ * FOR DEBUGGING AND TESTING PURPOSES!
+ *
+ * @param id Cache ID to check.
+ * @return {@code True} if this is cheat cache ID.
+ */
+ @Deprecated
public static boolean cheatCache(int id) {
return cheatCacheId != 0 && id == cheatCacheId;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdbf90a7/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 41b71f9..297ec68 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
@@ -1303,18 +1303,6 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
/** {@inheritDoc} */
@Override public void put(K key, V val) {
- // TODO
- if (CU.cheatCache(ctx.cacheId())) {
- try {
- delegate.put(key, val);
- }
- catch (IgniteCheckedException e) {
- throw cacheException(e);
- }
-
- return;
- }
-
try {
GridCacheGateway<K, V> gate = this.gate;
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdbf90a7/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 38a8223..30a3d57 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
@@ -1104,13 +1104,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
waitTopFut);
- // TODO
- if (CU.cheatCache(ctx.cacheId())) {
- updateFut.map();
-
- return updateFut;
- }
-
return asyncOp(new CO<IgniteInternalFuture<Object>>() {
@Override public IgniteInternalFuture<Object> apply() {
updateFut.map();
@@ -1152,13 +1145,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
final GridNearAtomicAbstractUpdateFuture updateFut =
createSingleUpdateFuture(key, val, proc, invokeArgs, retval, filter, waitTopFut);
- // TODO
- if (CU.cheatCache(ctx.cacheId())) {
- updateFut.map();
-
- return updateFut;
- }
-
return asyncOp(new CO<IgniteInternalFuture<Object>>() {
@Override public IgniteInternalFuture<Object> apply() {
updateFut.map();
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdbf90a7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index a7a1f7a..30a0c3d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -611,11 +611,9 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
* @param remapKeys Keys to remap.
*/
void map(AffinityTopologyVersion topVer, @Nullable Collection<KeyCacheObject> remapKeys) {
- // TODO
- Collection<ClusterNode> topNodes = CU.cheatCache(cctx.cacheId()) ?
- Collections.<ClusterNode>emptyList() : CU.affinityNodes(cctx, topVer);
+ Collection<ClusterNode> topNodes = CU.affinityNodes(cctx, topVer);
- if (!CU.cheatCache(cctx.cacheId()) && F.isEmpty(topNodes)) {
+ if (F.isEmpty(topNodes)) {
onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
"left the grid)."));
@@ -653,10 +651,6 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
singleReq0 = mapSingleUpdate(topVer, futVer, updVer);
}
else {
- // TODO
- if (CU.cheatCache(cctx.cacheId()))
- throw new RuntimeException();
-
Map<UUID, GridNearAtomicUpdateRequest> pendingMappings = mapUpdate(topNodes,
topVer,
futVer,