ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [05/11] ignite git commit: IGNITE-2264: Correct HashSet sizes.
Date Sun, 03 Jan 2016 20:17:21 GMT
IGNITE-2264: Correct HashSet sizes.


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

Branch: refs/heads/ignite-2264
Commit: 4a116bd8bbf774f646af964c7c67b4b785cf4144
Parents: 521ca89
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Sun Jan 3 23:08:12 2016 +0400
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Sun Jan 3 23:08:12 2016 +0400

----------------------------------------------------------------------
 .../cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java       | 4 ++--
 .../ignite/internal/managers/discovery/GridDiscoveryManager.java | 4 ++--
 .../ignite/internal/processors/cache/GridCacheEntrySet.java      | 4 ++--
 .../cache/distributed/dht/atomic/GridDhtAtomicCache.java         | 3 +--
 .../cache/transactions/IgniteTxImplicitSingleStateImpl.java      | 4 ++--
 .../processors/datastructures/GridCacheQueueAdapter.java         | 2 +-
 .../apache/ignite/internal/processors/igfs/IgfsModeResolver.java | 4 ++--
 .../tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java    | 2 +-
 8 files changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4a116bd8/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
index a82d541..73bfce0 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
@@ -23,7 +23,6 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
@@ -33,6 +32,7 @@ import org.apache.ignite.cache.eviction.EvictionPolicy;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.cache.CacheEvictableEntryImpl;
 import org.apache.ignite.internal.processors.igfs.IgfsBlockKey;
+import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentLinkedDeque8;
 import org.jsr166.ConcurrentLinkedDeque8.Node;
@@ -312,7 +312,7 @@ public class IgfsPerBlockLruEvictionPolicy implements EvictionPolicy<IgfsBlockKe
             Collection<String> excludePaths0 = excludePaths;
 
             if (excludePaths0 != null) {
-                excludePatterns0 = new HashSet<>(excludePaths0.size(), 1.0f);
+                excludePatterns0 = U.newHashSet(excludePaths0.size());
 
                 for (String excludePath : excludePaths0) {
                     try {

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a116bd8/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 844fd0f..fbf3989 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2472,8 +2472,8 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
             Map<String, Collection<ClusterNode>> cacheMap = new HashMap<>(allNodes.size(),
1.0f);
             Map<String, Collection<ClusterNode>> rmtCacheMap = new HashMap<>(allNodes.size(),
1.0f);
             Map<String, Collection<ClusterNode>> dhtNodesMap = new HashMap<>(allNodes.size(),
1.0f);
-            Collection<ClusterNode> nodesWithCaches = new HashSet<>(allNodes.size());
-            Collection<ClusterNode> rmtNodesWithCaches = new HashSet<>(allNodes.size());
+            Collection<ClusterNode> nodesWithCaches = U.newHashSet(allNodes.size());
+            Collection<ClusterNode> rmtNodesWithCaches = U.newHashSet(allNodes.size());
 
             aliveCacheNodes = new ConcurrentHashMap8<>(allNodes.size(), 1.0f);
             aliveRmtCacheNodes = new ConcurrentHashMap8<>(allNodes.size(), 1.0f);

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a116bd8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
index 1dbc564..634a97e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache;
 
 import java.util.AbstractSet;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 import javax.cache.Cache;
@@ -27,6 +26,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.jetbrains.annotations.Nullable;
 
@@ -50,7 +50,7 @@ public class GridCacheEntrySet<K, V> extends AbstractSet<Cache.Entry<K,
V>> {
      */
     public GridCacheEntrySet(GridCacheContext<K, V> ctx, Collection<? extends Cache.Entry<K,
V>> c,
         @Nullable IgnitePredicate<Cache.Entry<K, V>>... filter) {
-        set = new HashSet<>(c.size(), 1.0f);
+        set = U.newHashSet(c.size());
 
         assert ctx != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a116bd8/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 e0b108b..a34b00e 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
@@ -23,7 +23,6 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -2417,7 +2416,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             for (GridCacheMapEntry entry : locked) {
                 if (entry != null && entry.deleted()) {
                     if (skip == null)
-                        skip = new HashSet<>(locked.size(), 1.0f);
+                        skip = U.newHashSet(locked.size());
 
                     skip.add(entry.key());
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a116bd8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
index 3e0231e..58decd9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
@@ -164,7 +164,7 @@ public class IgniteTxImplicitSingleStateImpl extends IgniteTxLocalStateAdapter
{
         CacheStoreManager store = cacheCtx.store();
 
         if (store.configured()) {
-            HashSet<CacheStoreManager> set = new HashSet<>(3, 0.75f);
+            HashSet<CacheStoreManager> set = U.newHashSet(3);
 
             set.add(store);
 
@@ -201,7 +201,7 @@ public class IgniteTxImplicitSingleStateImpl extends IgniteTxLocalStateAdapter
{
     /** {@inheritDoc} */
     @Override public Set<IgniteTxKey> writeSet() {
         if (entry != null) {
-            HashSet<IgniteTxKey> set = new HashSet<>(3, 0.75f);
+            HashSet<IgniteTxKey> set = U.newHashSet(3);
 
             set.add(entry.txKey());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a116bd8/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
index ca0250d..58ad35f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
@@ -425,7 +425,7 @@ public abstract class GridCacheQueueAdapter<T> extends AbstractCollection<T>
imp
         long endIdx,
         int batchSize)
         throws IgniteCheckedException {
-        Set<QueueItemKey> keys = new HashSet<>(batchSize > 0 ? batchSize :
10);
+        Set<QueueItemKey> keys = U.newHashSet(batchSize > 0 ? batchSize : 10);
 
         for (long idx = startIdx; idx < endIdx; idx++) {
             keys.add(itemKey(id, name, collocated, binaryMarsh, idx));

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a116bd8/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsModeResolver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsModeResolver.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsModeResolver.java
index 70da103..aab90ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsModeResolver.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsModeResolver.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.igfs;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -28,6 +27,7 @@ import org.apache.ignite.igfs.IgfsMode;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.util.GridBoundedConcurrentLinkedHashMap;
 import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -123,7 +123,7 @@ public class IgfsModeResolver {
             Set<IgfsMode> children = childrenModesCache.get(path);
 
             if (children == null) {
-                children = new HashSet<>(IgfsMode.values().length, 1.0f);
+                children = U.newHashSet(IgfsMode.values().length);
 
                 IgfsMode pathDefault = dfltMode;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a116bd8/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
index 8402cbf..b56ed2d 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
@@ -340,7 +340,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder
{
 
         addrSnds = new ArrayList<>(locAddrs.size());
 
-        reqItfs = new HashSet<>(locAddrs.size()); // Interfaces used to send requests.
+        reqItfs = U.newHashSet(locAddrs.size()); // Interfaces used to send requests.
 
         for (String locAddr : locAddrs) {
             InetAddress addr;


Mime
View raw message