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/14 15:16:09 UTC
[1/3] ignite git commit: IGNITE-3007: Implemented.
Repository: ignite
Updated Branches:
refs/heads/ignite-2926 9ea980a5e -> 15869f313
IGNITE-3007: Implemented.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/143ce341
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/143ce341
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/143ce341
Branch: refs/heads/ignite-2926
Commit: 143ce3415b3985525270ca16eb7098bad90b6a2d
Parents: b024235
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Apr 14 13:17:05 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Apr 14 13:17:05 2016 +0300
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 2 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 1235 +++++++++---------
2 files changed, 605 insertions(+), 632 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/143ce341/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 81109e3..4f8b32c 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
@@ -2896,7 +2896,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
GridNearAtomicUpdateFuture fut = (GridNearAtomicUpdateFuture)ctx.mvcc().atomicFuture(res.futureVersion());
if (fut != null)
- fut.onResult(nodeId, res);
+ fut.onResult(nodeId, res, false);
else
U.warn(log, "Failed to find near update future for update response (will ignore) " +
"[nodeId=" + nodeId + ", res=" + res + ']');
http://git-wip-us.apache.org/repos/asf/ignite/blob/143ce341/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 c4f48b0..9955df7 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
@@ -146,8 +146,42 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** Remap count. */
private int remapCnt;
- /** State. */
- private final UpdateState state;
+ /** Mutex to synchronize state updates. */
+ private final Object mux = new Object();
+
+ /** Current topology version. */
+ private AffinityTopologyVersion topVer = AffinityTopologyVersion.ZERO;
+
+ /** */
+ private GridCacheVersion updVer;
+
+ /** Topology version when got mapping error. */
+ private AffinityTopologyVersion mapErrTopVer;
+
+ /** Mappings if operations is mapped to more than one node. */
+ @GridToStringInclude
+ private Map<UUID, GridNearAtomicUpdateRequest> mappings;
+
+ /** */
+ private int resCnt;
+
+ /** Error. */
+ private CachePartialUpdateCheckedException err;
+
+ /** Future ID. */
+ private GridCacheVersion futVer;
+
+ /** Completion future for a particular topology version. */
+ private GridFutureAdapter<Void> topCompleteFut;
+
+ /** Keys to remap. */
+ private Collection<KeyCacheObject> remapKeys;
+
+ /** Not null is operation is mapped to single node. */
+ private GridNearAtomicUpdateRequest singleReq;
+
+ /** Operation result. */
+ private GridCacheReturn opRes;
/**
* @param cctx Cache context.
@@ -229,8 +263,6 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
remapCnt = 1;
this.remapCnt = remapCnt;
-
- state = new UpdateState();
}
/** {@inheritDoc} */
@@ -240,7 +272,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** {@inheritDoc} */
@Override public GridCacheVersion version() {
- return state.futureVersion();
+ synchronized (mux) {
+ return futVer;
+ }
}
/**
@@ -258,7 +292,33 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** {@inheritDoc} */
@Override public boolean onNodeLeft(UUID nodeId) {
- state.onNodeLeft(nodeId);
+ GridNearAtomicUpdateResponse res = null;
+
+ synchronized (mux) {
+ GridNearAtomicUpdateRequest req;
+
+ if (singleReq != null)
+ req = singleReq.nodeId().equals(nodeId) ? singleReq : null;
+ else
+ req = mappings != null ? mappings.get(nodeId) : null;
+
+ if (req != null && req.response() == null) {
+ res = new GridNearAtomicUpdateResponse(cctx.cacheId(),
+ nodeId,
+ req.futureVersion(),
+ cctx.deploymentEnabled());
+
+ ClusterTopologyCheckedException e = new ClusterTopologyCheckedException("Primary node left grid " +
+ "before response is received: " + nodeId);
+
+ e.retryReadyFuture(cctx.shared().nextAffinityReadyFuture(req.topologyVersion()));
+
+ res.addFailedKeys(req.keys(), e);
+ }
+ }
+
+ if (res != null)
+ onResult(nodeId, res, true);
return false;
}
@@ -287,14 +347,14 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
// Cannot remap.
remapCnt = 1;
- state.map(topVer, null);
+ map(topVer, null);
}
}
/** {@inheritDoc} */
@Override public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer) {
if (waitForPartitionExchange()) {
- GridFutureAdapter<Void> fut = state.completeFuture(topVer);
+ GridFutureAdapter<Void> fut = completeFuture0(topVer);
if (fut != null && isDone()) {
fut.onDone();
@@ -323,7 +383,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
retval = Collections.emptyMap();
if (super.onDone(retval, err)) {
- GridCacheVersion futVer = state.onFutureDone();
+ GridCacheVersion futVer = onFutureDone();
if (futVer != null)
cctx.mvcc().removeAtomicFuture(futVer);
@@ -339,9 +399,208 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
*
* @param nodeId Node ID.
* @param res Update response.
+ * @param nodeErr {@code True} if response was created on node failure.
*/
- public void onResult(UUID nodeId, GridNearAtomicUpdateResponse res) {
- state.onResult(nodeId, res, false);
+ @SuppressWarnings({"unchecked", "ThrowableResultOfMethodCallIgnored"})
+ public void onResult(UUID nodeId, GridNearAtomicUpdateResponse res, boolean nodeErr) {
+ GridNearAtomicUpdateRequest req;
+
+ AffinityTopologyVersion remapTopVer = null;
+
+ GridCacheReturn opRes0 = null;
+ CachePartialUpdateCheckedException err0 = null;
+
+ boolean rcvAll;
+
+ GridFutureAdapter<?> fut0 = null;
+
+ synchronized (mux) {
+ if (!res.futureVersion().equals(futVer))
+ return;
+
+ if (singleReq != null) {
+ if (!singleReq.nodeId().equals(nodeId))
+ return;
+
+ req = singleReq;
+
+ singleReq = null;
+
+ rcvAll = true;
+ }
+ else {
+ req = mappings != null ? mappings.get(nodeId) : null;
+
+ if (req != null && req.onResponse(res)) {
+ resCnt++;
+
+ rcvAll = mappings.size() == resCnt;
+ }
+ else
+ return;
+ }
+
+ assert req != null && req.topologyVersion().equals(topVer) : req;
+
+ if (res.remapKeys() != null) {
+ assert !fastMap || cctx.kernalContext().clientNode();
+
+ if (remapKeys == null)
+ remapKeys = U.newHashSet(res.remapKeys().size());
+
+ remapKeys.addAll(res.remapKeys());
+
+ if (mapErrTopVer == null || mapErrTopVer.compareTo(req.topologyVersion()) < 0)
+ mapErrTopVer = req.topologyVersion();
+ }
+ else if (res.error() != null) {
+ if (res.failedKeys() != null)
+ addFailedKeys(res.failedKeys(), req.topologyVersion(), res.error());
+ }
+ else {
+ if (!req.fastMap() || req.hasPrimary()) {
+ GridCacheReturn ret = res.returnValue();
+
+ if (op == TRANSFORM) {
+ if (ret != null)
+ addInvokeResults(ret);
+ }
+ else
+ opRes = ret;
+ }
+ }
+
+ if (rcvAll) {
+ if (remapKeys != null) {
+ assert mapErrTopVer != null;
+
+ remapTopVer = cctx.shared().exchange().topologyVersion();
+ }
+ else {
+ if (err != null &&
+ X.hasCause(err, CachePartialUpdateCheckedException.class) &&
+ X.hasCause(err, ClusterTopologyCheckedException.class) &&
+ storeFuture() &&
+ --remapCnt > 0) {
+ ClusterTopologyCheckedException topErr =
+ X.cause(err, ClusterTopologyCheckedException.class);
+
+ if (!(topErr instanceof ClusterTopologyServerNotFoundException)) {
+ CachePartialUpdateCheckedException cause =
+ X.cause(err, CachePartialUpdateCheckedException.class);
+
+ assert cause != null && cause.topologyVersion() != null : err;
+
+ remapTopVer =
+ new AffinityTopologyVersion(cause.topologyVersion().topologyVersion() + 1);
+
+ err = null;
+
+ Collection<Object> failedKeys = cause.failedKeys();
+
+ remapKeys = new ArrayList<>(failedKeys.size());
+
+ for (Object key : failedKeys)
+ remapKeys.add(cctx.toCacheKeyObject(key));
+
+ updVer = null;
+ }
+ }
+ }
+
+ if (remapTopVer == null) {
+ err0 = err;
+ opRes0 = opRes;
+ }
+ else {
+ fut0 = topCompleteFut;
+
+ topCompleteFut = null;
+
+ cctx.mvcc().removeAtomicFuture(futVer);
+
+ futVer = null;
+ topVer = AffinityTopologyVersion.ZERO;
+ }
+ }
+ }
+
+ if (res.error() != null && res.failedKeys() == null) {
+ onDone(res.error());
+
+ return;
+ }
+
+ if (rcvAll && nearEnabled) {
+ if (mappings != null) {
+ for (GridNearAtomicUpdateRequest req0 : mappings.values()) {
+ GridNearAtomicUpdateResponse res0 = req0.response();
+
+ assert res0 != null : req0;
+
+ updateNear(req0, res0);
+ }
+ }
+ else if (!nodeErr)
+ updateNear(req, res);
+ }
+
+ if (remapTopVer != null) {
+ if (fut0 != null)
+ fut0.onDone();
+
+ if (!waitTopFut) {
+ onDone(new GridCacheTryPutFailedException());
+
+ return;
+ }
+
+ if (topLocked) {
+ assert !F.isEmpty(remapKeys) : remapKeys;
+
+ CachePartialUpdateCheckedException e =
+ new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible).");
+
+ ClusterTopologyCheckedException cause = new ClusterTopologyCheckedException(
+ "Failed to update keys, topology changed while execute atomic update inside transaction.");
+
+ cause.retryReadyFuture(cctx.affinity().affinityReadyFuture(remapTopVer));
+
+ e.add(remapKeys, cause);
+
+ onDone(e);
+
+ return;
+ }
+
+ IgniteInternalFuture<AffinityTopologyVersion> fut =
+ cctx.shared().exchange().affinityReadyFuture(remapTopVer);
+
+ if (fut == null)
+ fut = new GridFinishedFuture<>(remapTopVer);
+
+ fut.listen(new CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
+ @Override public void apply(final IgniteInternalFuture<AffinityTopologyVersion> fut) {
+ cctx.kernalContext().closure().runLocalSafe(new Runnable() {
+ @Override public void run() {
+ try {
+ AffinityTopologyVersion topVer = fut.get();
+
+ map(topVer, remapKeys);
+ }
+ catch (IgniteCheckedException e) {
+ onDone(e);
+ }
+ }
+ });
+ }
+ });
+
+ return;
+ }
+
+ if (rcvAll)
+ onDone(opRes0, err0);
}
/**
@@ -414,7 +673,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
cache.topology().readUnlock();
}
- state.map(topVer, null);
+ map(topVer, null);
}
/**
@@ -457,7 +716,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
cache.updateAllAsyncInternal(nodeId, req,
new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@Override public void apply(GridNearAtomicUpdateRequest req, GridNearAtomicUpdateResponse res) {
- onResult(res.nodeId(), res);
+ onResult(res.nodeId(), res, false);
}
});
}
@@ -472,7 +731,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
onDone(new GridCacheReturn(cctx, true, true, null, true));
}
catch (IgniteCheckedException e) {
- state.onSendError(req, e);
+ onSendError(req, e);
}
}
}
@@ -503,7 +762,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
}
catch (IgniteCheckedException e) {
- state.onSendError(req, e);
+ onSendError(req, e);
}
}
}
@@ -512,7 +771,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
cache.updateAllAsyncInternal(cctx.localNodeId(), locUpdate,
new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@Override public void apply(GridNearAtomicUpdateRequest req, GridNearAtomicUpdateResponse res) {
- onResult(res.nodeId(), res);
+ onResult(res.nodeId(), res, false);
}
});
}
@@ -522,428 +781,144 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
/**
- *
+ * @param req Request.
+ * @param e Error.
*/
- private class UpdateState {
- /** Current topology version. */
- private AffinityTopologyVersion topVer = AffinityTopologyVersion.ZERO;
-
- /** */
- private GridCacheVersion updVer;
-
- /** Topology version when got mapping error. */
- private AffinityTopologyVersion mapErrTopVer;
+ void onSendError(GridNearAtomicUpdateRequest req, IgniteCheckedException e) {
+ synchronized (mux) {
+ GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(cctx.cacheId(),
+ req.nodeId(),
+ req.futureVersion(),
+ cctx.deploymentEnabled());
- /** Mappings if operations is mapped to more than one node. */
- @GridToStringInclude
- private Map<UUID, GridNearAtomicUpdateRequest> mappings;
+ res.addFailedKeys(req.keys(), e);
- /** */
- private int resCnt;
-
- /** Error. */
- private CachePartialUpdateCheckedException err;
-
- /** Future ID. */
- private GridCacheVersion futVer;
-
- /** Completion future for a particular topology version. */
- private GridFutureAdapter<Void> topCompleteFut;
-
- /** Keys to remap. */
- private Collection<KeyCacheObject> remapKeys;
+ onResult(req.nodeId(), res, true);
+ }
+ }
- /** Not null is operation is mapped to single node. */
- private GridNearAtomicUpdateRequest singleReq;
+ /**
+ * @param topVer Topology version.
+ * @param remapKeys Keys to remap.
+ */
+ void map(AffinityTopologyVersion topVer, @Nullable Collection<KeyCacheObject> remapKeys) {
+ Collection<ClusterNode> topNodes = CU.affinityNodes(cctx, topVer);
- /** Operation result. */
- private GridCacheReturn opRes;
+ if (F.isEmpty(topNodes)) {
+ onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
+ "left the grid)."));
- /**
- * @return Future version.
- */
- @Nullable synchronized GridCacheVersion futureVersion() {
- return futVer;
+ return;
}
- /**
- * @param nodeId Left node ID.
- */
- void onNodeLeft(UUID nodeId) {
- GridNearAtomicUpdateResponse res = null;
+ Exception err = null;
+ GridNearAtomicUpdateRequest singleReq0 = null;
+ Map<UUID, GridNearAtomicUpdateRequest> mappings0 = null;
- synchronized (this) {
- GridNearAtomicUpdateRequest req;
+ int size = keys.size();
- if (singleReq != null)
- req = singleReq.nodeId().equals(nodeId) ? singleReq : null;
- else
- req = mappings != null ? mappings.get(nodeId) : null;
+ GridCacheVersion futVer = cctx.versions().next(topVer);
- if (req != null && req.response() == null) {
- res = new GridNearAtomicUpdateResponse(cctx.cacheId(),
- nodeId,
- req.futureVersion(),
- cctx.deploymentEnabled());
+ GridCacheVersion updVer;
- ClusterTopologyCheckedException e = new ClusterTopologyCheckedException("Primary node left grid " +
- "before response is received: " + nodeId);
+ // Assign version on near node in CLOCK ordering mode even if fastMap is false.
+ if (cctx.config().getAtomicWriteOrderMode() == CLOCK) {
+ updVer = this.updVer;
- e.retryReadyFuture(cctx.shared().nextAffinityReadyFuture(req.topologyVersion()));
+ if (updVer == null) {
+ updVer = cctx.versions().next(topVer);
- res.addFailedKeys(req.keys(), e);
- }
+ if (log.isDebugEnabled())
+ log.debug("Assigned fast-map version for update on near node: " + updVer);
}
-
- if (res != null)
- onResult(nodeId, res, true);
}
+ else
+ updVer = null;
- /**
- * @param nodeId Node ID.
- * @param res Response.
- * @param nodeErr {@code True} if response was created on node failure.
- */
- @SuppressWarnings("unchecked")
- void onResult(UUID nodeId, GridNearAtomicUpdateResponse res, boolean nodeErr) {
- GridNearAtomicUpdateRequest req;
-
- AffinityTopologyVersion remapTopVer = null;
-
- GridCacheReturn opRes0 = null;
- CachePartialUpdateCheckedException err0 = null;
-
- boolean rcvAll;
-
- GridFutureAdapter<?> fut0 = null;
-
- synchronized (this) {
- if (!res.futureVersion().equals(futVer))
- return;
-
- if (singleReq != null) {
- if (!singleReq.nodeId().equals(nodeId))
- return;
-
- req = singleReq;
-
- singleReq = null;
-
- rcvAll = true;
- }
- else {
- req = mappings != null ? mappings.get(nodeId) : null;
-
- if (req != null && req.onResponse(res)) {
- resCnt++;
-
- rcvAll = mappings.size() == resCnt;
- }
- else
- return;
- }
-
- assert req != null && req.topologyVersion().equals(topVer) : req;
-
- if (res.remapKeys() != null) {
- assert !fastMap || cctx.kernalContext().clientNode();
-
- if (remapKeys == null)
- remapKeys = U.newHashSet(res.remapKeys().size());
-
- remapKeys.addAll(res.remapKeys());
+ try {
+ if (size == 1 && !fastMap) {
+ assert remapKeys == null || remapKeys.size() == 1;
- if (mapErrTopVer == null || mapErrTopVer.compareTo(req.topologyVersion()) < 0)
- mapErrTopVer = req.topologyVersion();
- }
- else if (res.error() != null) {
- if (res.failedKeys() != null)
- addFailedKeys(res.failedKeys(), req.topologyVersion(), res.error());
- }
+ singleReq0 = mapSingleUpdate(topVer, futVer, updVer);
+ }
+ else {
+ Map<UUID, GridNearAtomicUpdateRequest> pendingMappings = mapUpdate(topNodes,
+ topVer,
+ futVer,
+ updVer,
+ remapKeys);
+
+ if (pendingMappings.size() == 1)
+ singleReq0 = F.firstValue(pendingMappings);
else {
- if (!req.fastMap() || req.hasPrimary()) {
- GridCacheReturn ret = res.returnValue();
+ if (syncMode == PRIMARY_SYNC) {
+ mappings0 = U.newHashMap(pendingMappings.size());
- if (op == TRANSFORM) {
- if (ret != null)
- addInvokeResults(ret);
+ for (GridNearAtomicUpdateRequest req : pendingMappings.values()) {
+ if (req.hasPrimary())
+ mappings0.put(req.nodeId(), req);
}
- else
- opRes = ret;
}
- }
-
- if (rcvAll) {
- if (remapKeys != null) {
- assert mapErrTopVer != null;
-
- remapTopVer = cctx.shared().exchange().topologyVersion();
- }
- else {
- if (err != null &&
- X.hasCause(err, CachePartialUpdateCheckedException.class) &&
- X.hasCause(err, ClusterTopologyCheckedException.class) &&
- storeFuture() &&
- --remapCnt > 0) {
- ClusterTopologyCheckedException topErr =
- X.cause(err, ClusterTopologyCheckedException.class);
-
- if (!(topErr instanceof ClusterTopologyServerNotFoundException)) {
- CachePartialUpdateCheckedException cause =
- X.cause(err, CachePartialUpdateCheckedException.class);
-
- assert cause != null && cause.topologyVersion() != null : err;
-
- remapTopVer =
- new AffinityTopologyVersion(cause.topologyVersion().topologyVersion() + 1);
-
- err = null;
-
- Collection<Object> failedKeys = cause.failedKeys();
-
- remapKeys = new ArrayList<>(failedKeys.size());
-
- for (Object key : failedKeys)
- remapKeys.add(cctx.toCacheKeyObject(key));
-
- updVer = null;
- }
- }
- }
-
- if (remapTopVer == null) {
- err0 = err;
- opRes0 = opRes;
- }
- else {
- fut0 = topCompleteFut;
-
- topCompleteFut = null;
-
- cctx.mvcc().removeAtomicFuture(futVer);
+ else
+ mappings0 = pendingMappings;
- futVer = null;
- topVer = AffinityTopologyVersion.ZERO;
- }
+ assert !mappings0.isEmpty() || size == 0 : this;
}
}
- if (res.error() != null && res.failedKeys() == null) {
- onDone(res.error());
-
- return;
- }
+ synchronized (mux) {
+ assert this.futVer == null : this;
+ assert this.topVer == AffinityTopologyVersion.ZERO : this;
- if (rcvAll && nearEnabled) {
- if (mappings != null) {
- for (GridNearAtomicUpdateRequest req0 : mappings.values()) {
- GridNearAtomicUpdateResponse res0 = req0.response();
+ this.topVer = topVer;
+ this.updVer = updVer;
+ this.futVer = futVer;
- assert res0 != null : req0;
+ resCnt = 0;
- updateNear(req0, res0);
- }
- }
- else if (!nodeErr)
- updateNear(req, res);
- }
-
- if (remapTopVer != null) {
- if (fut0 != null)
- fut0.onDone();
-
- if (!waitTopFut) {
- onDone(new GridCacheTryPutFailedException());
+ singleReq = singleReq0;
+ mappings = mappings0;
- return;
- }
-
- if (topLocked) {
- assert !F.isEmpty(remapKeys) : remapKeys;
-
- CachePartialUpdateCheckedException e =
- new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible).");
-
- ClusterTopologyCheckedException cause = new ClusterTopologyCheckedException(
- "Failed to update keys, topology changed while execute atomic update inside transaction.");
-
- cause.retryReadyFuture(cctx.affinity().affinityReadyFuture(remapTopVer));
-
- e.add(remapKeys, cause);
-
- onDone(e);
-
- return;
- }
-
- IgniteInternalFuture<AffinityTopologyVersion> fut =
- cctx.shared().exchange().affinityReadyFuture(remapTopVer);
-
- if (fut == null)
- fut = new GridFinishedFuture<>(remapTopVer);
-
- fut.listen(new CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
- @Override public void apply(final IgniteInternalFuture<AffinityTopologyVersion> fut) {
- cctx.kernalContext().closure().runLocalSafe(new Runnable() {
- @Override public void run() {
- try {
- AffinityTopologyVersion topVer = fut.get();
-
- map(topVer, remapKeys);
- }
- catch (IgniteCheckedException e) {
- onDone(e);
- }
- }
- });
- }
- });
-
- return;
+ this.remapKeys = null;
}
-
- if (rcvAll)
- onDone(opRes0, err0);
+ }
+ catch (Exception e) {
+ err = e;
}
- /**
- * @param req Request.
- * @param e Error.
- */
- void onSendError(GridNearAtomicUpdateRequest req, IgniteCheckedException e) {
- synchronized (this) {
- GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(cctx.cacheId(),
- req.nodeId(),
- req.futureVersion(),
- cctx.deploymentEnabled());
-
- res.addFailedKeys(req.keys(), e);
+ if (err != null) {
+ onDone(err);
- onResult(req.nodeId(), res, true);
- }
+ return;
}
- /**
- * @param topVer Topology version.
- * @param remapKeys Keys to remap.
- */
- void map(AffinityTopologyVersion topVer, @Nullable Collection<KeyCacheObject> remapKeys) {
- Collection<ClusterNode> topNodes = CU.affinityNodes(cctx, topVer);
-
- if (F.isEmpty(topNodes)) {
- onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
- "left the grid)."));
+ if (storeFuture()) {
+ if (!cctx.mvcc().addAtomicFuture(futVer, this)) {
+ assert isDone() : this;
return;
}
+ }
- Exception err = null;
- GridNearAtomicUpdateRequest singleReq0 = null;
- Map<UUID, GridNearAtomicUpdateRequest> mappings0 = null;
-
- int size = keys.size();
-
- GridCacheVersion futVer = cctx.versions().next(topVer);
-
- GridCacheVersion updVer;
-
- // Assign version on near node in CLOCK ordering mode even if fastMap is false.
- if (cctx.config().getAtomicWriteOrderMode() == CLOCK) {
- updVer = this.updVer;
-
- if (updVer == null) {
- updVer = cctx.versions().next(topVer);
+ // Optimize mapping for single key.
+ if (singleReq0 != null)
+ mapSingle(singleReq0.nodeId(), singleReq0);
+ else {
+ assert mappings0 != null;
- if (log.isDebugEnabled())
- log.debug("Assigned fast-map version for update on near node: " + updVer);
- }
- }
+ if (size == 0)
+ onDone(new GridCacheReturn(cctx, true, true, null, true));
else
- updVer = null;
-
- try {
- if (size == 1 && !fastMap) {
- assert remapKeys == null || remapKeys.size() == 1;
-
- singleReq0 = mapSingleUpdate(topVer, futVer, updVer);
- }
- else {
- Map<UUID, GridNearAtomicUpdateRequest> pendingMappings = mapUpdate(topNodes,
- topVer,
- futVer,
- updVer,
- remapKeys);
-
- if (pendingMappings.size() == 1)
- singleReq0 = F.firstValue(pendingMappings);
- else {
- if (syncMode == PRIMARY_SYNC) {
- mappings0 = U.newHashMap(pendingMappings.size());
-
- for (GridNearAtomicUpdateRequest req : pendingMappings.values()) {
- if (req.hasPrimary())
- mappings0.put(req.nodeId(), req);
- }
- }
- else
- mappings0 = pendingMappings;
-
- assert !mappings0.isEmpty() || size == 0 : GridNearAtomicUpdateFuture.this;
- }
- }
-
- synchronized (this) {
- assert this.futVer == null : this;
- assert this.topVer == AffinityTopologyVersion.ZERO : this;
-
- this.topVer = topVer;
- this.updVer = updVer;
- this.futVer = futVer;
-
- resCnt = 0;
-
- singleReq = singleReq0;
- mappings = mappings0;
-
- this.remapKeys = null;
- }
- }
- catch (Exception e) {
- err = e;
- }
-
- if (err != null) {
- onDone(err);
-
- return;
- }
-
- if (storeFuture()) {
- if (!cctx.mvcc().addAtomicFuture(futVer, GridNearAtomicUpdateFuture.this)) {
- assert isDone() : GridNearAtomicUpdateFuture.this;
-
- return;
- }
- }
-
- // Optimize mapping for single key.
- if (singleReq0 != null)
- mapSingle(singleReq0.nodeId(), singleReq0);
- else {
- assert mappings0 != null;
-
- if (size == 0)
- onDone(new GridCacheReturn(cctx, true, true, null, true));
- else
- doUpdate(mappings0);
- }
+ doUpdate(mappings0);
}
+ }
- /**
- * @param topVer Topology version.
- * @return Future.
- */
- @Nullable synchronized GridFutureAdapter<Void> completeFuture(AffinityTopologyVersion topVer) {
+ /**
+ * @param topVer Topology version.
+ * @return Future.
+ */
+ @Nullable GridFutureAdapter<Void> completeFuture0(AffinityTopologyVersion topVer) {
+ synchronized (mux) {
if (this.topVer == AffinityTopologyVersion.ZERO)
return null;
@@ -956,176 +931,67 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
return null;
}
+ }
- /**
- * @return Future version.
- */
- GridCacheVersion onFutureDone() {
- GridCacheVersion ver0;
-
- GridFutureAdapter<Void> fut0;
-
- synchronized (this) {
- fut0 = topCompleteFut;
+ /**
+ * @return Future version.
+ */
+ GridCacheVersion onFutureDone() {
+ GridCacheVersion ver0;
- topCompleteFut = null;
+ GridFutureAdapter<Void> fut0;
- ver0 = futVer;
+ synchronized (mux) {
+ fut0 = topCompleteFut;
- futVer = null;
- }
+ topCompleteFut = null;
- if (fut0 != null)
- fut0.onDone();
+ ver0 = futVer;
- return ver0;
+ futVer = null;
}
- /**
- * @param topNodes Cache nodes.
- * @param topVer Topology version.
- * @param futVer Future version.
- * @param updVer Update version.
- * @param remapKeys Keys to remap.
- * @return Mapping.
- * @throws Exception If failed.
- */
- private Map<UUID, GridNearAtomicUpdateRequest> mapUpdate(Collection<ClusterNode> topNodes,
- AffinityTopologyVersion topVer,
- GridCacheVersion futVer,
- @Nullable GridCacheVersion updVer,
- @Nullable Collection<KeyCacheObject> remapKeys) throws Exception {
- Iterator<?> it = null;
-
- if (vals != null)
- it = vals.iterator();
-
- Iterator<GridCacheDrInfo> conflictPutValsIt = null;
-
- if (conflictPutVals != null)
- conflictPutValsIt = conflictPutVals.iterator();
-
- Iterator<GridCacheVersion> conflictRmvValsIt = null;
-
- if (conflictRmvVals != null)
- conflictRmvValsIt = conflictRmvVals.iterator();
-
- Map<UUID, GridNearAtomicUpdateRequest> pendingMappings = U.newHashMap(topNodes.size());
-
- // Create mappings first, then send messages.
- for (Object key : keys) {
- if (key == null)
- throw new NullPointerException("Null key.");
-
- Object val;
- GridCacheVersion conflictVer;
- long conflictTtl;
- long conflictExpireTime;
-
- if (vals != null) {
- val = it.next();
- conflictVer = null;
- conflictTtl = CU.TTL_NOT_CHANGED;
- conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
-
- if (val == null)
- throw new NullPointerException("Null value.");
- }
- else if (conflictPutVals != null) {
- GridCacheDrInfo conflictPutVal = conflictPutValsIt.next();
+ if (fut0 != null)
+ fut0.onDone();
- val = conflictPutVal.valueEx();
- conflictVer = conflictPutVal.version();
- conflictTtl = conflictPutVal.ttl();
- conflictExpireTime = conflictPutVal.expireTime();
- }
- else if (conflictRmvVals != null) {
- val = null;
- conflictVer = conflictRmvValsIt.next();
- conflictTtl = CU.TTL_NOT_CHANGED;
- conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
- }
- else {
- val = null;
- conflictVer = null;
- conflictTtl = CU.TTL_NOT_CHANGED;
- conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
- }
-
- if (val == null && op != GridCacheOperation.DELETE)
- continue;
-
- KeyCacheObject cacheKey = cctx.toCacheKeyObject(key);
-
- if (remapKeys != null && !remapKeys.contains(cacheKey))
- continue;
+ return ver0;
+ }
- if (op != TRANSFORM)
- val = cctx.toCacheObject(val);
+ /**
+ * @param topNodes Cache nodes.
+ * @param topVer Topology version.
+ * @param futVer Future version.
+ * @param updVer Update version.
+ * @param remapKeys Keys to remap.
+ * @return Mapping.
+ * @throws Exception If failed.
+ */
+ private Map<UUID, GridNearAtomicUpdateRequest> mapUpdate(Collection<ClusterNode> topNodes,
+ AffinityTopologyVersion topVer,
+ GridCacheVersion futVer,
+ @Nullable GridCacheVersion updVer,
+ @Nullable Collection<KeyCacheObject> remapKeys) throws Exception {
+ Iterator<?> it = null;
- Collection<ClusterNode> affNodes = mapKey(cacheKey, topVer, fastMap);
+ if (vals != null)
+ it = vals.iterator();
- if (affNodes.isEmpty())
- throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache " +
- "(all partition nodes left the grid).");
+ Iterator<GridCacheDrInfo> conflictPutValsIt = null;
- int i = 0;
-
- for (ClusterNode affNode : affNodes) {
- if (affNode == null)
- throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache " +
- "(all partition nodes left the grid).");
-
- UUID nodeId = affNode.id();
-
- GridNearAtomicUpdateRequest mapped = pendingMappings.get(nodeId);
-
- if (mapped == null) {
- mapped = new GridNearAtomicUpdateRequest(
- cctx.cacheId(),
- nodeId,
- futVer,
- fastMap,
- updVer,
- topVer,
- topLocked,
- syncMode,
- op,
- retval,
- expiryPlc,
- invokeArgs,
- filter,
- subjId,
- taskNameHash,
- skipStore,
- keepBinary,
- cctx.kernalContext().clientNode(),
- cctx.deploymentEnabled(),
- keys.size());
-
- pendingMappings.put(nodeId, mapped);
- }
+ if (conflictPutVals != null)
+ conflictPutValsIt = conflictPutVals.iterator();
- mapped.addUpdateEntry(cacheKey, val, conflictTtl, conflictExpireTime, conflictVer, i == 0);
+ Iterator<GridCacheVersion> conflictRmvValsIt = null;
- i++;
- }
- }
+ if (conflictRmvVals != null)
+ conflictRmvValsIt = conflictRmvVals.iterator();
- return pendingMappings;
- }
+ Map<UUID, GridNearAtomicUpdateRequest> pendingMappings = U.newHashMap(topNodes.size());
- /**
- * @param topVer Topology version.
- * @param futVer Future version.
- * @param updVer Update version.
- * @return Request.
- * @throws Exception If failed.
- */
- private GridNearAtomicUpdateRequest mapSingleUpdate(AffinityTopologyVersion topVer,
- GridCacheVersion futVer,
- @Nullable GridCacheVersion updVer) throws Exception {
- Object key = F.first(keys);
+ // Create mappings first, then send messages.
+ for (Object key : keys) {
+ if (key == null)
+ throw new NullPointerException("Null key.");
Object val;
GridCacheVersion conflictVer;
@@ -1133,131 +999,238 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
long conflictExpireTime;
if (vals != null) {
- // Regular PUT.
- val = F.first(vals);
+ val = it.next();
conflictVer = null;
conflictTtl = CU.TTL_NOT_CHANGED;
conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
+
+ if (val == null)
+ throw new NullPointerException("Null value.");
}
else if (conflictPutVals != null) {
- // Conflict PUT.
- GridCacheDrInfo conflictPutVal = F.first(conflictPutVals);
+ GridCacheDrInfo conflictPutVal = conflictPutValsIt.next();
val = conflictPutVal.valueEx();
conflictVer = conflictPutVal.version();
- conflictTtl = conflictPutVal.ttl();
+ conflictTtl = conflictPutVal.ttl();
conflictExpireTime = conflictPutVal.expireTime();
}
else if (conflictRmvVals != null) {
- // Conflict REMOVE.
val = null;
- conflictVer = F.first(conflictRmvVals);
+ conflictVer = conflictRmvValsIt.next();
conflictTtl = CU.TTL_NOT_CHANGED;
conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
}
else {
- // Regular REMOVE.
val = null;
conflictVer = null;
conflictTtl = CU.TTL_NOT_CHANGED;
conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
}
- // We still can get here if user pass map with single element.
- if (key == null)
- throw new NullPointerException("Null key.");
-
if (val == null && op != GridCacheOperation.DELETE)
- throw new NullPointerException("Null value.");
+ continue;
KeyCacheObject cacheKey = cctx.toCacheKeyObject(key);
+ if (remapKeys != null && !remapKeys.contains(cacheKey))
+ continue;
+
if (op != TRANSFORM)
val = cctx.toCacheObject(val);
- ClusterNode primary = cctx.affinity().primary(cacheKey, topVer);
-
- if (primary == null)
- throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
- "left the grid).");
-
- GridNearAtomicUpdateRequest req = new GridNearAtomicUpdateRequest(
- cctx.cacheId(),
- primary.id(),
- futVer,
- fastMap,
- updVer,
- topVer,
- topLocked,
- syncMode,
- op,
- retval,
- expiryPlc,
- invokeArgs,
- filter,
- subjId,
- taskNameHash,
- skipStore,
- keepBinary,
- cctx.kernalContext().clientNode(),
- cctx.deploymentEnabled(),
- 1);
-
- req.addUpdateEntry(cacheKey,
- val,
- conflictTtl,
- conflictExpireTime,
- conflictVer,
- true);
-
- return req;
- }
+ Collection<ClusterNode> affNodes = mapKey(cacheKey, topVer, fastMap);
- /**
- * @param ret Result from single node.
- */
- @SuppressWarnings("unchecked")
- private void addInvokeResults(GridCacheReturn ret) {
- assert op == TRANSFORM : op;
- assert ret.value() == null || ret.value() instanceof Map : ret.value();
-
- if (ret.value() != null) {
- if (opRes != null)
- opRes.mergeEntryProcessResults(ret);
- else
- opRes = ret;
- }
- }
+ if (affNodes.isEmpty())
+ throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache " +
+ "(all partition nodes left the grid).");
+
+ int i = 0;
+
+ for (ClusterNode affNode : affNodes) {
+ if (affNode == null)
+ throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache " +
+ "(all partition nodes left the grid).");
- /**
- * @param failedKeys Failed keys.
- * @param topVer Topology version for failed update.
- * @param err Error cause.
- */
- private void addFailedKeys(Collection<KeyCacheObject> failedKeys,
- AffinityTopologyVersion topVer,
- Throwable err) {
- CachePartialUpdateCheckedException err0 = this.err;
+ UUID nodeId = affNode.id();
- if (err0 == null)
- err0 = this.err = new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible).");
+ GridNearAtomicUpdateRequest mapped = pendingMappings.get(nodeId);
- Collection<Object> keys = new ArrayList<>(failedKeys.size());
+ if (mapped == null) {
+ mapped = new GridNearAtomicUpdateRequest(
+ cctx.cacheId(),
+ nodeId,
+ futVer,
+ fastMap,
+ updVer,
+ topVer,
+ topLocked,
+ syncMode,
+ op,
+ retval,
+ expiryPlc,
+ invokeArgs,
+ filter,
+ subjId,
+ taskNameHash,
+ skipStore,
+ keepBinary,
+ cctx.kernalContext().clientNode(),
+ cctx.deploymentEnabled(),
+ keys.size());
+
+ pendingMappings.put(nodeId, mapped);
+ }
+
+ mapped.addUpdateEntry(cacheKey, val, conflictTtl, conflictExpireTime, conflictVer, i == 0);
+
+ i++;
+ }
+ }
- for (KeyCacheObject key : failedKeys)
- keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false));
+ return pendingMappings;
+ }
- err0.add(keys, err, topVer);
+ /**
+ * @param topVer Topology version.
+ * @param futVer Future version.
+ * @param updVer Update version.
+ * @return Request.
+ * @throws Exception If failed.
+ */
+ private GridNearAtomicUpdateRequest mapSingleUpdate(AffinityTopologyVersion topVer,
+ GridCacheVersion futVer,
+ @Nullable GridCacheVersion updVer) throws Exception {
+ Object key = F.first(keys);
+
+ Object val;
+ GridCacheVersion conflictVer;
+ long conflictTtl;
+ long conflictExpireTime;
+
+ if (vals != null) {
+ // Regular PUT.
+ val = F.first(vals);
+ conflictVer = null;
+ conflictTtl = CU.TTL_NOT_CHANGED;
+ conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
}
+ else if (conflictPutVals != null) {
+ // Conflict PUT.
+ GridCacheDrInfo conflictPutVal = F.first(conflictPutVals);
+
+ val = conflictPutVal.valueEx();
+ conflictVer = conflictPutVal.version();
+ conflictTtl = conflictPutVal.ttl();
+ conflictExpireTime = conflictPutVal.expireTime();
+ }
+ else if (conflictRmvVals != null) {
+ // Conflict REMOVE.
+ val = null;
+ conflictVer = F.first(conflictRmvVals);
+ conflictTtl = CU.TTL_NOT_CHANGED;
+ conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
+ }
+ else {
+ // Regular REMOVE.
+ val = null;
+ conflictVer = null;
+ conflictTtl = CU.TTL_NOT_CHANGED;
+ conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
+ }
+
+ // We still can get here if user pass map with single element.
+ if (key == null)
+ throw new NullPointerException("Null key.");
+
+ if (val == null && op != GridCacheOperation.DELETE)
+ throw new NullPointerException("Null value.");
+
+ KeyCacheObject cacheKey = cctx.toCacheKeyObject(key);
+
+ if (op != TRANSFORM)
+ val = cctx.toCacheObject(val);
+
+ ClusterNode primary = cctx.affinity().primary(cacheKey, topVer);
+
+ if (primary == null)
+ throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " +
+ "left the grid).");
+
+ GridNearAtomicUpdateRequest req = new GridNearAtomicUpdateRequest(
+ cctx.cacheId(),
+ primary.id(),
+ futVer,
+ fastMap,
+ updVer,
+ topVer,
+ topLocked,
+ syncMode,
+ op,
+ retval,
+ expiryPlc,
+ invokeArgs,
+ filter,
+ subjId,
+ taskNameHash,
+ skipStore,
+ keepBinary,
+ cctx.kernalContext().clientNode(),
+ cctx.deploymentEnabled(),
+ 1);
+
+ req.addUpdateEntry(cacheKey,
+ val,
+ conflictTtl,
+ conflictExpireTime,
+ conflictVer,
+ true);
+
+ return req;
+ }
- /** {@inheritDoc} */
- @Override public synchronized String toString() {
- return S.toString(UpdateState.class, this);
+ /**
+ * @param ret Result from single node.
+ */
+ @SuppressWarnings("unchecked")
+ private void addInvokeResults(GridCacheReturn ret) {
+ assert op == TRANSFORM : op;
+ assert ret.value() == null || ret.value() instanceof Map : ret.value();
+
+ if (ret.value() != null) {
+ if (opRes != null)
+ opRes.mergeEntryProcessResults(ret);
+ else
+ opRes = ret;
}
}
+ /**
+ * @param failedKeys Failed keys.
+ * @param topVer Topology version for failed update.
+ * @param err Error cause.
+ */
+ private void addFailedKeys(Collection<KeyCacheObject> failedKeys,
+ AffinityTopologyVersion topVer,
+ Throwable err) {
+ CachePartialUpdateCheckedException err0 = this.err;
+
+ if (err0 == null)
+ err0 = this.err =
+ new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible).");
+
+ Collection<Object> keys = new ArrayList<>(failedKeys.size());
+
+ for (KeyCacheObject key : failedKeys)
+ keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false));
+
+ err0.add(keys, err, topVer);
+ }
+
/** {@inheritDoc} */
public String toString() {
- return S.toString(GridNearAtomicUpdateFuture.class, this, super.toString());
+ synchronized (mux) {
+ return S.toString(GridNearAtomicUpdateFuture.class, this, super.toString());
+ }
}
}
[2/3] ignite git commit: IGNITE-2926: WIP.
Posted by vo...@apache.org.
IGNITE-2926: WIP.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17080659
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17080659
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17080659
Branch: refs/heads/ignite-2926
Commit: 17080659b28ea02f6b95e63fb00dac7bd19c7add
Parents: 143ce34
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Apr 14 16:15:37 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Apr 14 16:15:37 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAtomicFuture.java | 5 -
.../GridAbstractNearAtomicUpdateFuture.java | 187 ++++++++++++++
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 5 -
.../dht/atomic/GridNearAtomicUpdateFuture.java | 247 +++----------------
4 files changed, 227 insertions(+), 217 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/17080659/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java
index 359909e..c96d00f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicFuture.java
@@ -38,9 +38,4 @@ public interface GridCacheAtomicFuture<R> extends GridCacheFuture<R> {
* @return Future or {@code null} if no need to wait.
*/
public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer);
-
- /**
- * @return Future keys.
- */
- public Collection<?> keys();
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/17080659/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAbstractNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAbstractNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAbstractNearAtomicUpdateFuture.java
new file mode 100644
index 0000000..e40e8ca
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridAbstractNearAtomicUpdateFuture.java
@@ -0,0 +1,187 @@
+/*
+ * 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.distributed.dht.atomic;
+
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
+import org.apache.ignite.internal.processors.cache.GridCacheAffinityManager;
+import org.apache.ignite.internal.processors.cache.GridCacheAtomicFuture;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.GridCacheMvccManager;
+import org.apache.ignite.internal.processors.cache.GridCacheOperation;
+import org.apache.ignite.internal.processors.cache.KeyCacheObject;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteUuid;
+import org.jetbrains.annotations.Nullable;
+
+import javax.cache.expiry.ExpiryPolicy;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicReference;
+
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.CLOCK;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_ASYNC;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.internal.processors.cache.GridCacheOperation.TRANSFORM;
+
+/**
+ * Base for near atomic update futures.
+ */
+public abstract class GridAbstractNearAtomicUpdateFuture extends GridFutureAdapter<Object>
+ implements GridCacheAtomicFuture<Object> {
+ /** Logger reference. */
+ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
+
+ /** Logger. */
+ protected static IgniteLogger log;
+
+ /** Cache context. */
+ protected final GridCacheContext cctx;
+
+ /** Cache. */
+ protected final GridDhtAtomicCache cache;
+
+ /** Write synchronization mode. */
+ protected final CacheWriteSynchronizationMode syncMode;
+
+ /** Update operation. */
+ protected final GridCacheOperation op;
+
+ /** Return value require flag. */
+ protected final boolean retval;
+
+ /** Raw return value flag. */
+ protected final boolean rawRetval;
+
+ /** Expiry policy. */
+ protected final ExpiryPolicy expiryPlc;
+
+ /** Optional filter. */
+ protected final CacheEntryPredicate[] filter;
+
+ /** Subject ID. */
+ protected final UUID subjId;
+
+ /** Task name hash. */
+ protected final int taskNameHash;
+
+ /** Skip store flag. */
+ protected final boolean skipStore;
+
+ /** Keep binary flag. */
+ protected final boolean keepBinary;
+
+ /** Wait for topology future flag. */
+ protected final boolean waitTopFut;
+
+ /** Fast map flag. */
+ protected final boolean fastMap;
+
+ /** Near cache flag. */
+ protected final boolean nearEnabled;
+
+ /** Mutex to synchronize state updates. */
+ protected final Object mux = new Object();
+
+ /**
+ * Constructor.
+ */
+ protected GridAbstractNearAtomicUpdateFuture(
+ GridCacheContext cctx,
+ GridDhtAtomicCache cache,
+ CacheWriteSynchronizationMode syncMode,
+ GridCacheOperation op,
+ boolean retval,
+ boolean rawRetval,
+ @Nullable ExpiryPolicy expiryPlc,
+ CacheEntryPredicate[] filter,
+ UUID subjId,
+ int taskNameHash,
+ boolean skipStore,
+ boolean keepBinary,
+ boolean waitTopFut
+ ) {
+ if (log == null)
+ log = U.logger(cctx.kernalContext(), logRef, GridFutureAdapter.class);
+
+ this.cctx = cctx;
+ this.cache = cache;
+ this.syncMode = syncMode;
+ this.op = op;
+ this.retval = retval;
+ this.rawRetval = rawRetval;
+ this.expiryPlc = expiryPlc;
+ this.filter = filter;
+ this.subjId = subjId;
+ this.taskNameHash = taskNameHash;
+ this.skipStore = skipStore;
+ this.keepBinary = keepBinary;
+ this.waitTopFut = waitTopFut;
+
+ fastMap = F.isEmpty(filter) && op != TRANSFORM && cctx.config().getWriteSynchronizationMode() == FULL_SYNC &&
+ cctx.config().getAtomicWriteOrderMode() == CLOCK &&
+ !(cctx.writeThrough() && cctx.config().getInterceptor() != null);
+
+ nearEnabled = CU.isNearEnabled(cctx);
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteUuid futureId() {
+ throw new UnsupportedOperationException();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean trackable() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void markNotTrackable() {
+ // No-op.
+ }
+
+ /**
+ * @return {@code True} future is stored by {@link GridCacheMvccManager#addAtomicFuture}.
+ */
+ protected boolean storeFuture() {
+ return cctx.config().getAtomicWriteOrderMode() == CLOCK || syncMode != FULL_ASYNC;
+ }
+
+ /**
+ * Maps key to nodes. If filters are absent and operation is not TRANSFORM, then we can assign version on near
+ * node and send updates in parallel to all participating nodes.
+ *
+ * @param key Key to map.
+ * @param topVer Topology version to map.
+ * @return Collection of nodes to which key is mapped.
+ */
+ protected Collection<ClusterNode> mapKey(KeyCacheObject key, AffinityTopologyVersion topVer) {
+ GridCacheAffinityManager affMgr = cctx.affinity();
+
+ // If we can send updates in parallel - do it.
+ return fastMap ? cctx.topology().nodes(affMgr.partition(key), topVer) :
+ Collections.singletonList(affMgr.primary(key, topVer));
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/17080659/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 9f52658..4721d6e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -212,11 +212,6 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void>
return null;
}
- /** {@inheritDoc} */
- @Override public Collection<KeyCacheObject> keys() {
- return keys;
- }
-
/**
* @param entry Entry to map.
* @param val Value to write.
http://git-wip-us.apache.org/repos/asf/ignite/blob/17080659/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 9955df7..d68b4ef 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
@@ -23,10 +23,8 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
-import java.util.concurrent.atomic.AtomicReference;
import javax.cache.expiry.ExpiryPolicy;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteInternalFuture;
@@ -35,10 +33,7 @@ import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException;
-import org.apache.ignite.internal.processors.cache.GridCacheAffinityManager;
-import org.apache.ignite.internal.processors.cache.GridCacheAtomicFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
-import org.apache.ignite.internal.processors.cache.GridCacheMvccManager;
import org.apache.ignite.internal.processors.cache.GridCacheOperation;
import org.apache.ignite.internal.processors.cache.GridCacheReturn;
import org.apache.ignite.internal.processors.cache.GridCacheTryPutFailedException;
@@ -57,35 +52,17 @@ import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteUuid;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.CLOCK;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_ASYNC;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
import static org.apache.ignite.internal.processors.cache.GridCacheOperation.TRANSFORM;
/**
* DHT atomic cache near update future.
*/
-public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
- implements GridCacheAtomicFuture<Object>{
- /** Logger reference. */
- private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
-
- /** Logger. */
- protected static IgniteLogger log;
-
- /** Cache context. */
- private final GridCacheContext cctx;
-
- /** Cache. */
- private GridDhtAtomicCache cache;
-
- /** Update operation. */
- private final GridCacheOperation op;
-
+public class GridNearAtomicUpdateFuture extends GridAbstractNearAtomicUpdateFuture {
/** Keys */
private Collection<?> keys;
@@ -104,51 +81,12 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
@SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"})
private Collection<GridCacheVersion> conflictRmvVals;
- /** Return value require flag. */
- private final boolean retval;
-
- /** Expiry policy. */
- private final ExpiryPolicy expiryPlc;
-
- /** Optional filter. */
- private final CacheEntryPredicate[] filter;
-
- /** Write synchronization mode. */
- private final CacheWriteSynchronizationMode syncMode;
-
- /** Raw return value flag. */
- private final boolean rawRetval;
-
- /** Fast map flag. */
- private final boolean fastMap;
-
- /** Near cache flag. */
- private final boolean nearEnabled;
-
- /** Subject ID. */
- private final UUID subjId;
-
- /** Task name hash. */
- private final int taskNameHash;
-
/** Topology locked flag. Set if atomic update is performed inside a TX or explicit lock. */
private boolean topLocked;
- /** Skip store flag. */
- private final boolean skipStore;
-
- /** */
- private final boolean keepBinary;
-
- /** Wait for topology future flag. */
- private final boolean waitTopFut;
-
/** Remap count. */
private int remapCnt;
- /** Mutex to synchronize state updates. */
- private final Object mux = new Object();
-
/** Current topology version. */
private AffinityTopologyVersion topVer = AffinityTopologyVersion.ZERO;
@@ -225,39 +163,19 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
int remapCnt,
boolean waitTopFut
) {
- this.rawRetval = rawRetval;
+ super(cctx, cache, syncMode, op, retval, rawRetval, expiryPlc, filter, subjId, taskNameHash, skipStore,
+ keepBinary, waitTopFut);
assert vals == null || vals.size() == keys.size();
assert conflictPutVals == null || conflictPutVals.size() == keys.size();
assert conflictRmvVals == null || conflictRmvVals.size() == keys.size();
assert subjId != null;
- this.cctx = cctx;
- this.cache = cache;
- this.syncMode = syncMode;
- this.op = op;
this.keys = keys;
this.vals = vals;
this.invokeArgs = invokeArgs;
this.conflictPutVals = conflictPutVals;
this.conflictRmvVals = conflictRmvVals;
- this.retval = retval;
- this.expiryPlc = expiryPlc;
- this.filter = filter;
- this.subjId = subjId;
- this.taskNameHash = taskNameHash;
- this.skipStore = skipStore;
- this.keepBinary = keepBinary;
- this.waitTopFut = waitTopFut;
-
- if (log == null)
- log = U.logger(cctx.kernalContext(), logRef, GridFutureAdapter.class);
-
- fastMap = F.isEmpty(filter) && op != TRANSFORM && cctx.config().getWriteSynchronizationMode() == FULL_SYNC &&
- cctx.config().getAtomicWriteOrderMode() == CLOCK &&
- !(cctx.writeThrough() && cctx.config().getInterceptor() != null);
-
- nearEnabled = CU.isNearEnabled(cctx);
if (!waitTopFut)
remapCnt = 1;
@@ -266,30 +184,12 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
/** {@inheritDoc} */
- @Override public IgniteUuid futureId() {
- throw new UnsupportedOperationException();
- }
-
- /** {@inheritDoc} */
@Override public GridCacheVersion version() {
synchronized (mux) {
return futVer;
}
}
- /**
- * @return {@code True} if this future should block partition map exchange.
- */
- private boolean waitForPartitionExchange() {
- // Wait fast-map near atomic update futures in CLOCK mode.
- return fastMap;
- }
-
- /** {@inheritDoc} */
- @Override public Collection<?> keys() {
- return keys;
- }
-
/** {@inheritDoc} */
@Override public boolean onNodeLeft(UUID nodeId) {
GridNearAtomicUpdateResponse res = null;
@@ -323,16 +223,6 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
return false;
}
- /** {@inheritDoc} */
- @Override public boolean trackable() {
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public void markNotTrackable() {
- // No-op.
- }
-
/**
* Performs future mapping.
*/
@@ -353,8 +243,20 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
/** {@inheritDoc} */
@Override public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer) {
- if (waitForPartitionExchange()) {
- GridFutureAdapter<Void> fut = completeFuture0(topVer);
+ // Wait fast-map near atomic update futures in CLOCK mode.
+ if (fastMap) {
+ GridFutureAdapter<Void> fut;
+
+ synchronized (mux) {
+ if (this.topVer != AffinityTopologyVersion.ZERO && this.topVer.compareTo(topVer) < 0) {
+ if (topCompleteFut == null)
+ topCompleteFut = new GridFutureAdapter<>();
+
+ fut = topCompleteFut;
+ }
+ else
+ fut = null;
+ }
if (fut != null && isDone()) {
fut.onDone();
@@ -454,16 +356,34 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
mapErrTopVer = req.topologyVersion();
}
else if (res.error() != null) {
- if (res.failedKeys() != null)
- addFailedKeys(res.failedKeys(), req.topologyVersion(), res.error());
+ if (res.failedKeys() != null) {
+ if (err == null)
+ err = new CachePartialUpdateCheckedException(
+ "Failed to update keys (retry update if possible).");
+
+ Collection<Object> keys = new ArrayList<>(res.failedKeys().size());
+
+ for (KeyCacheObject key : res.failedKeys())
+ keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false));
+
+ err.add(keys, res.error(), req.topologyVersion());
+ }
}
else {
if (!req.fastMap() || req.hasPrimary()) {
GridCacheReturn ret = res.returnValue();
if (op == TRANSFORM) {
- if (ret != null)
- addInvokeResults(ret);
+ if (ret != null) {
+ assert ret.value() == null || ret.value() instanceof Map : ret.value();
+
+ if (ret.value() != null) {
+ if (opRes != null)
+ opRes.mergeEntryProcessResults(ret);
+ else
+ opRes = ret;
+ }
+ }
}
else
opRes = ret;
@@ -677,35 +597,6 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
/**
- * @return {@code True} future is stored by {@link GridCacheMvccManager#addAtomicFuture}.
- */
- private boolean storeFuture() {
- return cctx.config().getAtomicWriteOrderMode() == CLOCK || syncMode != FULL_ASYNC;
- }
-
- /**
- * Maps key to nodes. If filters are absent and operation is not TRANSFORM, then we can assign version on near
- * node and send updates in parallel to all participating nodes.
- *
- * @param key Key to map.
- * @param topVer Topology version to map.
- * @param fastMap Flag indicating whether mapping is performed for fast-circuit update.
- * @return Collection of nodes to which key is mapped.
- */
- private Collection<ClusterNode> mapKey(
- KeyCacheObject key,
- AffinityTopologyVersion topVer,
- boolean fastMap
- ) {
- GridCacheAffinityManager affMgr = cctx.affinity();
-
- // If we can send updates in parallel - do it.
- return fastMap ?
- cctx.topology().nodes(affMgr.partition(key), topVer) :
- Collections.singletonList(affMgr.primary(key, topVer));
- }
-
- /**
* Maps future to single node.
*
* @param nodeId Node ID.
@@ -914,26 +805,6 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
/**
- * @param topVer Topology version.
- * @return Future.
- */
- @Nullable GridFutureAdapter<Void> completeFuture0(AffinityTopologyVersion topVer) {
- synchronized (mux) {
- if (this.topVer == AffinityTopologyVersion.ZERO)
- return null;
-
- if (this.topVer.compareTo(topVer) < 0) {
- if (topCompleteFut == null)
- topCompleteFut = new GridFutureAdapter<>();
-
- return topCompleteFut;
- }
-
- return null;
- }
- }
-
- /**
* @return Future version.
*/
GridCacheVersion onFutureDone() {
@@ -1039,7 +910,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (op != TRANSFORM)
val = cctx.toCacheObject(val);
- Collection<ClusterNode> affNodes = mapKey(cacheKey, topVer, fastMap);
+ Collection<ClusterNode> affNodes = mapKey(cacheKey, topVer);
if (affNodes.isEmpty())
throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache " +
@@ -1189,44 +1060,6 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
return req;
}
- /**
- * @param ret Result from single node.
- */
- @SuppressWarnings("unchecked")
- private void addInvokeResults(GridCacheReturn ret) {
- assert op == TRANSFORM : op;
- assert ret.value() == null || ret.value() instanceof Map : ret.value();
-
- if (ret.value() != null) {
- if (opRes != null)
- opRes.mergeEntryProcessResults(ret);
- else
- opRes = ret;
- }
- }
-
- /**
- * @param failedKeys Failed keys.
- * @param topVer Topology version for failed update.
- * @param err Error cause.
- */
- private void addFailedKeys(Collection<KeyCacheObject> failedKeys,
- AffinityTopologyVersion topVer,
- Throwable err) {
- CachePartialUpdateCheckedException err0 = this.err;
-
- if (err0 == null)
- err0 = this.err =
- new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible).");
-
- Collection<Object> keys = new ArrayList<>(failedKeys.size());
-
- for (KeyCacheObject key : failedKeys)
- keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false));
-
- err0.add(keys, err, topVer);
- }
-
/** {@inheritDoc} */
public String toString() {
synchronized (mux) {
[3/3] ignite git commit: Merge branch 'ignite-2926-1' into ignite-2926
Posted by vo...@apache.org.
Merge branch 'ignite-2926-1' into ignite-2926
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/15869f31
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/15869f31
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/15869f31
Branch: refs/heads/ignite-2926
Commit: 15869f313bfaea76ddd075dac97b0d675e15d446
Parents: 9ea980a 1708065
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Apr 14 16:16:00 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Apr 14 16:16:00 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAtomicFuture.java | 5 -
.../GridAbstractNearAtomicUpdateFuture.java | 187 +++
.../dht/atomic/GridDhtAtomicCache.java | 2 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 5 -
.../dht/atomic/GridNearAtomicUpdateFuture.java | 1358 ++++++++----------
5 files changed, 770 insertions(+), 787 deletions(-)
----------------------------------------------------------------------