ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [21/26] ignite git commit: Removed "initCnt".
Date Wed, 20 Apr 2016 07:12:26 GMT
Removed "initCnt".


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/776924b5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/776924b5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/776924b5

Branch: refs/heads/ignite-2523-1
Commit: 776924b5590b49000ad65be967425638e9120088
Parents: ff9e98a
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Apr 19 15:04:24 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Apr 19 15:04:24 2016 +0300

----------------------------------------------------------------------
 .../atomic/GridNearAtomicSingleUpdateRequest.java  | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/776924b5/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 f2a691f..f8bdbe4 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
@@ -30,7 +30,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.distributed.IgniteExternalizableExpiryPolicy;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.GridLongList;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.CU;
@@ -146,10 +145,6 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd
     @GridDirectTransient
     private GridNearAtomicUpdateResponse res;
 
-    /** Maximum possible size of inner collections. */
-    @GridDirectTransient
-    private int initSize;
-
     /**
      * Empty constructor required by {@link Externalizable}.
      */
@@ -226,13 +221,7 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd
         this.clientReq = clientReq;
         this.addDepInfo = addDepInfo;
 
-        // By default ArrayList expands to array of 10 elements on first add. We cannot guess
how many entries
-        // will be added to request because of unknown affinity distribution. However, we
DO KNOW how many keys
-        // participate in request. As such, we know upper bound of all collections in request.
If this bound is lower
-        // than 10, we use it.
-        initSize = Math.min(maxEntryCnt, 10);
-
-        keys = new ArrayList<>(initSize);
+        keys = new ArrayList<>(1);
     }
 
     /** {@inheritDoc} */
@@ -341,7 +330,7 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd
 
         if (entryProcessor != null) {
             if (entryProcessors == null)
-                entryProcessors = new ArrayList<>(initSize);
+                entryProcessors = new ArrayList<>(1);
 
             entryProcessors.add(entryProcessor);
         }
@@ -349,7 +338,7 @@ public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractUpd
             assert val instanceof CacheObject : val;
 
             if (vals == null)
-                vals = new ArrayList<>(initSize);
+                vals = new ArrayList<>(1);
 
             vals.add((CacheObject)val);
         }


Mime
View raw message