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/01/29 14:48:15 UTC
ignite git commit: IGNITE-2502: Fix.
Repository: ignite
Updated Branches:
refs/heads/ignite-2502 [created] bc28562ea
IGNITE-2502: Fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bc28562e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bc28562e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bc28562e
Branch: refs/heads/ignite-2502
Commit: bc28562ea08c93a291d5a5873738c22db273058d
Parents: c081e3d
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Jan 29 16:48:06 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Jan 29 16:48:06 2016 +0300
----------------------------------------------------------------------
.../dht/atomic/GridNearAtomicUpdateFuture.java | 6 ++++--
.../dht/atomic/GridNearAtomicUpdateRequest.java | 18 +++++++++++++-----
2 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/bc28562e/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 3c86083..29d5013 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
@@ -1100,7 +1100,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
skipStore,
keepBinary,
cctx.kernalContext().clientNode(),
- cctx.deploymentEnabled());
+ cctx.deploymentEnabled(),
+ keys.size());
pendingMappings.put(nodeId, mapped);
}
@@ -1199,7 +1200,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
skipStore,
keepBinary,
cctx.kernalContext().clientNode(),
- cctx.deploymentEnabled());
+ cctx.deploymentEnabled(),
+ 1);
req.addUpdateEntry(cacheKey,
val,
http://git-wip-us.apache.org/repos/asf/ignite/blob/bc28562e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index 9c4b486..4bc3180 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -158,6 +158,10 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
@GridDirectTransient
private GridNearAtomicUpdateResponse res;
+ /** Maximum possible size of inner collections. */
+ @GridDirectTransient
+ private int initSize;
+
/**
* Empty constructor required by {@link Externalizable}.
*/
@@ -187,6 +191,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
* @param keepBinary Keep binary flag.
* @param clientReq Client node request flag.
* @param addDepInfo Deployment info flag.
+ * @param maxEntryCnt Maximum entries count.
*/
public GridNearAtomicUpdateRequest(
int cacheId,
@@ -207,7 +212,8 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
boolean skipStore,
boolean keepBinary,
boolean clientReq,
- boolean addDepInfo
+ boolean addDepInfo,
+ int maxEntryCnt
) {
assert futVer != null;
@@ -232,7 +238,9 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
this.clientReq = clientReq;
this.addDepInfo = addDepInfo;
- keys = new ArrayList<>();
+ initSize = Math.min(maxEntryCnt, 10);
+
+ keys = new ArrayList<>(initSize);
}
/** {@inheritDoc} */
@@ -380,7 +388,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
if (entryProcessor != null) {
if (entryProcessors == null)
- entryProcessors = new ArrayList<>();
+ entryProcessors = new ArrayList<>(initSize);
entryProcessors.add(entryProcessor);
}
@@ -388,7 +396,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
assert val instanceof CacheObject : val;
if (vals == null)
- vals = new ArrayList<>();
+ vals = new ArrayList<>(initSize);
vals.add((CacheObject)val);
}
@@ -398,7 +406,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
// In case there is no conflict, do not create the list.
if (conflictVer != null) {
if (conflictVers == null) {
- conflictVers = new ArrayList<>();
+ conflictVers = new ArrayList<>(initSize);
for (int i = 0; i < keys.size() - 1; i++)
conflictVers.add(null);