diff --git a/concurrent/src/test/java/concurrent/hashmap/HashMapTest.java b/concurrent/src/test/java/concurrent/hashmap/HashMapTest.java new file mode 100644 index 0000000..831cd56 --- /dev/null +++ b/concurrent/src/test/java/concurrent/hashmap/HashMapTest.java @@ -0,0 +1,25 @@ +package concurrent.hashmap; + + +import org.junit.jupiter.api.Test; + +public class HashMapTest { + static final int MAXIMUM_CAPACITY = 1 << 30; + + @Test + public void LinkedBlockingQueueModelTest() throws InterruptedException { + System.out.println(tableSizeFor(1000)); + } + + static final int tableSizeFor(int cap) { + int n = cap - 1; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + int t = (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1; + return t; + } + +} diff --git a/elasticsearch/pom.xml b/elasticsearch/pom.xml index 8991654..ec690dd 100644 --- a/elasticsearch/pom.xml +++ b/elasticsearch/pom.xml @@ -15,5 +15,11 @@ 8 8 - + + + org.jeecgframework.jimureport + jimureport-spring-boot-starter + 1.4.2 + + \ No newline at end of file