ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [34/50] incubator-ignite git commit: # IGNITE-447 Remove unused methods.
Date Thu, 12 Mar 2015 11:28:17 GMT
# IGNITE-447 Remove unused methods.


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

Branch: refs/heads/ignite-333
Commit: 6c4282a1d0ddeffbd5a8d26715f535f54fa89747
Parents: a46067a
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Wed Mar 11 19:19:41 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed Mar 11 19:19:41 2015 +0300

----------------------------------------------------------------------
 .../internal/util/GridConcurrentFactory.java    | 59 --------------------
 .../ignite/jvmtest/ConcurrentMapTest.java       |  5 +-
 2 files changed, 3 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c4282a1/modules/core/src/main/java/org/apache/ignite/internal/util/GridConcurrentFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridConcurrentFactory.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridConcurrentFactory.java
index 4653449..8d53e6f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridConcurrentFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridConcurrentFactory.java
@@ -47,63 +47,4 @@ public class GridConcurrentFactory {
         return new ConcurrentHashMap8<>(16 * CONCURRENCY_LEVEL, 0.75f, CONCURRENCY_LEVEL);
     }
 
-    /**
-     * Creates concurrent map with default concurrency level and given {@code initCap}.
-     *
-     * @param initCap Initial capacity.
-     * @return New concurrent map.
-     */
-    public static <K, V> ConcurrentMap<K, V> newMap(int initCap) {
-        return new ConcurrentHashMap8<>(initialSize(initCap, CONCURRENCY_LEVEL), 0.75f,
CONCURRENCY_LEVEL);
-    }
-
-    /**
-     * Creates concurrent map with given concurrency level and initCap.
-     *
-     * @param initCap Initial capacity.
-     * @param concurrencyLevel Concurrency level.
-     * @return New concurrent map.
-     */
-    public static <K, V> ConcurrentMap<K, V> newMap(int initCap, int concurrencyLevel)
{
-        return new ConcurrentHashMap8<>(initialSize(initCap, concurrencyLevel), 0.75f,
concurrencyLevel);
-    }
-
-    /**
-     * Creates concurrent set with default concurrency level.
-     *
-     * @return New concurrent map.
-     */
-    public static <V> GridConcurrentHashSet<V> newSet() {
-        return new GridConcurrentHashSet<>(16 * CONCURRENCY_LEVEL, 0.75f, CONCURRENCY_LEVEL);
-    }
-
-    /**
-     * Creates concurrent set with default concurrency level and given {@code initCap}.
-     *
-     * @param initCap Initial capacity.
-     * @return New concurrent map.
-     */
-    public static <V> GridConcurrentHashSet<V> newSet(int initCap) {
-        return new GridConcurrentHashSet<>(initialSize(initCap, CONCURRENCY_LEVEL),
0.75f, CONCURRENCY_LEVEL);
-    }
-
-    /**
-     * Creates concurrent set with given concurrency level and initCap.
-     *
-     * @param initCap Initial capacity.
-     * @param concurrencyLevel Concurrency level.
-     * @return New concurrent map.
-     */
-    public static <V> GridConcurrentHashSet<V> newSet(int initCap, int concurrencyLevel)
{
-        return new GridConcurrentHashSet<>(initialSize(initCap, concurrencyLevel),
0.75f, concurrencyLevel);
-    }
-
-    /**
-     * @param cap Capacity.
-     * @param concurrencyLevel Concurrency level.
-     * @return Calculated size.
-     */
-    private static int initialSize(int cap, int concurrencyLevel) {
-        return cap / concurrencyLevel < 16 ? 16 * concurrencyLevel : cap;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c4282a1/modules/core/src/test/java/org/apache/ignite/jvmtest/ConcurrentMapTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/jvmtest/ConcurrentMapTest.java b/modules/core/src/test/java/org/apache/ignite/jvmtest/ConcurrentMapTest.java
index f3fb442..81165ca 100644
--- a/modules/core/src/test/java/org/apache/ignite/jvmtest/ConcurrentMapTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/jvmtest/ConcurrentMapTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.jvmtest;
 
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.testframework.*;
@@ -56,7 +55,9 @@ public class ConcurrentMapTest {
 
             X.println("Testing map with concurrency level: " + lvl);
 
-            int writes = testMap(100000, GridConcurrentFactory.<String, Integer>newMap(256,
lvl));
+            int cap = 256 / lvl < 16 ? 16 * lvl : 256;
+
+            int writes = testMap(100000, new ConcurrentHashMap8<String, Integer>(cap,
0.75f, lvl));
 
             ress.add(F.pair(lvl, writes));
         }


Mime
View raw message