IGNITE-104 - Ordered ATOMIC updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c8b67de1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c8b67de1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c8b67de1 Branch: refs/heads/ignite-104 Commit: c8b67de10e3a4ccee5c828fb31f542821724ae0b Parents: 7b161f0 Author: Valentin Kulichenko <vkuliche...@gridgain.com> Authored: Wed Aug 5 15:28:30 2015 -0700 Committer: Valentin Kulichenko <vkuliche...@gridgain.com> Committed: Wed Aug 5 15:28:30 2015 -0700 ---------------------------------------------------------------------- .../dht/atomic/GridNearAtomicUpdateFuture.java | 33 +++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c8b67de1/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 c4704cf..5b364a5 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 @@ -395,27 +395,23 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> Iterator<GridCacheDrInfo> conflictPutValsIt = conflictPutVals != null ? conflictPutVals.iterator() : null; Iterator<GridCacheVersion> conflictRmvValsIt = conflictRmvVals != null ? conflictRmvVals.iterator() : null; - for (Object key : failed) { - while (keyIt.hasNext()) { - Object nextKey = keyIt.next(); - Object nextVal = valsIt != null ? valsIt.next() : null; - GridCacheDrInfo nextConflictPutVal = conflictPutValsIt != null ? conflictPutValsIt.next() : null; - GridCacheVersion nextConflictRmvVal = conflictRmvValsIt != null ? conflictRmvValsIt.next() : null; + while (keyIt.hasNext()) { + Object nextKey = keyIt.next(); + Object nextVal = valsIt != null ? valsIt.next() : null; + GridCacheDrInfo nextConflictPutVal = conflictPutValsIt != null ? conflictPutValsIt.next() : null; + GridCacheVersion nextConflictRmvVal = conflictRmvValsIt != null ? conflictRmvValsIt.next() : null; - if (F.eq(key, nextKey)) { - remapKeys.add(nextKey); + if (failed.contains(nextKey)) { + remapKeys.add(nextKey); - if (remapVals != null) - remapVals.add(nextVal); + if (remapVals != null) + remapVals.add(nextVal); - if (remapConflictPutVals != null) - remapConflictPutVals.add(nextConflictPutVal); + if (remapConflictPutVals != null) + remapConflictPutVals.add(nextConflictPutVal); - if (remapConflictRmvVals != null) - remapConflictRmvVals.add(nextConflictRmvVal); - - break; - } + if (remapConflictRmvVals != null) + remapConflictRmvVals.add(nextConflictRmvVal); } } @@ -473,8 +469,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class); - if (F.isEmpty(cause.failedKeys())) - cause.printStackTrace(); + assert !F.isEmpty(cause.failedKeys()); remap(cause.failedKeys());