You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/04/26 08:40:13 UTC
[04/15] ignite git commit: Removing TODOs..
Removing TODOs..
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/034621d1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/034621d1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/034621d1
Branch: refs/heads/ignite-2523-1-dht
Commit: 034621d171ce3d94c1ca8f38114e38c4c0ebae4e
Parents: 6a48b48
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Apr 25 12:38:25 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Apr 25 12:38:25 2016 +0300
----------------------------------------------------------------------
.../GridNearAtomicAbstractUpdateRequest.java | 9 --------
.../GridNearAtomicSingleUpdateFuture.java | 23 ++++++++++----------
2 files changed, 11 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/034621d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
index 37d9e45..a12c2dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
@@ -110,7 +110,6 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
/**
* @return Filter.
*/
- // TODO
@Nullable public abstract CacheEntryPredicate[] filter();
/**
@@ -133,7 +132,6 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
/**
* @return Keys for this update request.
*/
- // TODO
public abstract List<KeyCacheObject> keys();
/**
@@ -144,7 +142,6 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
/**
* @return Values for this update request.
*/
- // TODO
public abstract List<?> values();
/**
@@ -178,28 +175,24 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
/**
* @return Conflict versions.
*/
- // TODO
@Nullable public abstract List<GridCacheVersion> conflictVersions();
/**
* @param idx Index.
* @return Conflict version.
*/
- // TODO
@Nullable public abstract GridCacheVersion conflictVersion(int idx);
/**
* @param idx Index.
* @return Conflict TTL.
*/
- // TODO
public abstract long conflictTtl(int idx);
/**
* @param idx Index.
* @return Conflict expire time.
*/
- // TODO
public abstract long conflictExpireTime(int idx);
/**
@@ -211,13 +204,11 @@ public abstract class GridNearAtomicAbstractUpdateRequest extends GridCacheMessa
* @param res Response.
* @return {@code True} if current response was {@code null}.
*/
- // TODO
public abstract boolean onResponse(GridNearAtomicUpdateResponse res);
/**
* @return Response.
*/
- // TODO
@Nullable public abstract GridNearAtomicUpdateResponse response();
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/034621d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
index 196de69..d8c217e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
@@ -66,6 +66,15 @@ import static org.apache.ignite.internal.processors.cache.GridCacheOperation.TRA
* DHT atomic cache near update future.
*/
public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpdateFuture {
+ /** Failure detection timeout feature major version. */
+ private static final byte SINGLE_REQ_MAJOR_VER = 1;
+
+ /** Failure detection timeout feature minor version. */
+ private static final byte SINGLE_REQ_MINOR_VER = 6;
+
+ /** Failure detection timeout feature maintainance version. */
+ private static final byte SINGLE_REQ_MAINT_VER = 0;
+
/** Optional filter. */
private final CacheEntryPredicate filter;
@@ -616,26 +625,16 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
"left the grid).");
- // TODO: Can we change it to affNodes.get(0)?
ClusterNode primary = cctx.affinity().primary(cacheKey, topVer);
assert primary != null;
- boolean single = true;
-
- // TODO: Instead, we could implement a method on affinity to check if all nodes are greater than particular ver.
- for (ClusterNode affNode : affNodes) {
- if (!affNode.version().greaterThanEqual(1, 1, 6)) {
- single = false;
-
- break;
- }
- }
+ boolean single =
+ primary.version().greaterThanEqual(SINGLE_REQ_MAJOR_VER, SINGLE_REQ_MINOR_VER, SINGLE_REQ_MAINT_VER);
GridNearAtomicAbstractUpdateRequest req;
if (single) {
- // TODO: Refactor that?
CacheOperationFilter filter0;
CacheObject filterVal = null;