Removed "addValue" method.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/32001add Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/32001add Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/32001add Branch: refs/heads/ignite-2523-1 Commit: 32001addacbc3f2ffdba540b99fca981d78f10aa Parents: 13e3e02 Author: vozerov-gridgain <[email protected]> Authored: Tue Apr 19 15:21:46 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Tue Apr 19 15:21:46 2016 +0300 ---------------------------------------------------------------------- .../GridNearAtomicSingleUpdateFuture.java | 10 ++-- .../GridNearAtomicSingleUpdateRequest.java | 59 +++++++++----------- 2 files changed, 31 insertions(+), 38 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/32001add/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 2f16181..844c4b3 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 @@ -623,7 +623,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda GridNearAtomicAbstractUpdateRequest req; if (single) { - GridNearAtomicSingleUpdateRequest req0 = new GridNearAtomicSingleUpdateRequest( + req = new GridNearAtomicSingleUpdateRequest( cctx.cacheId(), primary.id(), futVer, @@ -642,11 +642,9 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda skipStore, keepBinary, cctx.kernalContext().clientNode(), - cctx.deploymentEnabled()); - - req0.addUpdateEntry(cacheKey, val); - - req = req0; + cctx.deploymentEnabled(), + cacheKey, + val); } else { GridNearAtomicUpdateRequest req0 = new GridNearAtomicUpdateRequest( http://git-wip-us.apache.org/repos/asf/ignite/blob/32001add/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java index 9f9da59..41d0c8b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java @@ -118,9 +118,6 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd /** Filter. */ private CacheEntryPredicate[] filter; - /** Flag indicating whether request contains primary keys. */ - private boolean hasPrimary; - /** Subject ID. */ private UUID subjId; @@ -169,7 +166,10 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd * @param keepBinary Keep binary flag. * @param clientReq Client node request flag. * @param addDepInfo Deployment info flag. + * @param key Key. + * @param val Value. */ + @SuppressWarnings("unchecked") public GridNearAtomicSingleUpdateRequest( int cacheId, UUID nodeId, @@ -189,7 +189,9 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd boolean skipStore, boolean keepBinary, boolean clientReq, - boolean addDepInfo + boolean addDepInfo, + KeyCacheObject key, + Object val ) { assert futVer != null; @@ -213,6 +215,27 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd this.keepBinary = keepBinary; this.clientReq = clientReq; this.addDepInfo = addDepInfo; + + EntryProcessor<Object, Object, Object> entryProcessor = null; + + if (op == TRANSFORM) { + assert val instanceof EntryProcessor : val; + + entryProcessor = (EntryProcessor<Object, Object, Object>) val; + } + + assert val != null || op == DELETE; + + this.key = key; + + if (entryProcessor != null) { + this.entryProcessor = entryProcessor; + } + else if (val != null) { + assert val instanceof CacheObject : val; + + this.val = (CacheObject)val; + } } /** {@inheritDoc} */ @@ -300,34 +323,6 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd return keepBinary; } - /** - * @param key Key to add. - * @param val Optional update value. - */ - @SuppressWarnings("unchecked") - public void addUpdateEntry(KeyCacheObject key, @Nullable Object val) { - EntryProcessor<Object, Object, Object> entryProcessor = null; - - if (op == TRANSFORM) { - assert val instanceof EntryProcessor : val; - - entryProcessor = (EntryProcessor<Object, Object, Object>) val; - } - - assert val != null || op == DELETE; - - this.key = key; - - if (entryProcessor != null) { - this.entryProcessor = entryProcessor; - } - else if (val != null) { - assert val instanceof CacheObject : val; - - this.val = (CacheObject)val; - } - } - /** {@inheritDoc} */ @Override public List<KeyCacheObject> keys() { return Collections.singletonList(key);
