diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/QueueTypeEnum.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/QueueTypeEnum.java index 389b3fb9..f5706497 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/QueueTypeEnum.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/QueueTypeEnum.java @@ -130,7 +130,7 @@ public enum QueueTypeEnum { } else if (Objects.equals(type, PRIORITY_BLOCKING_QUEUE.type)) { blockingQueue = new PriorityBlockingQueue(capacity); } else if (Objects.equals(type, RESIZABLE_LINKED_BLOCKING_QUEUE.type)) { - blockingQueue = new ResizableCapacityLinkedBlockIngQueue(capacity); + blockingQueue = new ResizableCapacityLinkedBlockingQueue(capacity); } Collection customBlockingQueues = DynamicThreadPoolServiceLoader diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockIngQueue.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockingQueue.java similarity index 90% rename from hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockIngQueue.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockingQueue.java index ff900969..7f1c2b94 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockIngQueue.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockingQueue.java @@ -13,9 +13,9 @@ import java.util.concurrent.atomic.AtomicInteger; * @date 2021/6/20 14:24 */ @Slf4j -public class ResizableCapacityLinkedBlockIngQueue extends LinkedBlockingQueue { +public class ResizableCapacityLinkedBlockingQueue extends LinkedBlockingQueue { - public ResizableCapacityLinkedBlockIngQueue(int capacity) { + public ResizableCapacityLinkedBlockingQueue(int capacity) { super(capacity); } diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java index db041b04..3b5f032c 100644 --- a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java @@ -282,8 +282,8 @@ public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPool if (!Objects.equals(beforeProperties.getQueueCapacity(), properties.getQueueCapacity()) && Objects.equals(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.name, executor.getQueue().getClass().getSimpleName())) { - if (executor.getQueue() instanceof ResizableCapacityLinkedBlockIngQueue) { - ResizableCapacityLinkedBlockIngQueue queue = (ResizableCapacityLinkedBlockIngQueue) executor.getQueue(); + if (executor.getQueue() instanceof ResizableCapacityLinkedBlockingQueue) { + ResizableCapacityLinkedBlockingQueue queue = (ResizableCapacityLinkedBlockingQueue) executor.getQueue(); queue.setCapacity(properties.getQueueCapacity()); } else { log.warn("The queue length cannot be modified. Queue type mismatch. Current queue type :: {}", executor.getQueue().getClass().getSimpleName()); diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java index c756bd42..e851ae58 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java @@ -11,7 +11,7 @@ import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; import cn.hippo4j.core.executor.support.AbstractDynamicExecutorSupport; import cn.hippo4j.core.executor.support.QueueTypeEnum; import cn.hippo4j.core.executor.support.RejectedTypeEnum; -import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockIngQueue; +import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockingQueue; import cn.hippo4j.core.proxy.RejectedProxyUtil; import cn.hippo4j.common.api.ThreadPoolDynamicRefresh; import lombok.AllArgsConstructor; @@ -133,8 +133,8 @@ public class ServerThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh if (parameter.getCapacity() != null && Objects.equals(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.type, parameter.getQueueType())) { - if (executor.getQueue() instanceof ResizableCapacityLinkedBlockIngQueue) { - ResizableCapacityLinkedBlockIngQueue queue = (ResizableCapacityLinkedBlockIngQueue) executor.getQueue(); + if (executor.getQueue() instanceof ResizableCapacityLinkedBlockingQueue) { + ResizableCapacityLinkedBlockingQueue queue = (ResizableCapacityLinkedBlockingQueue) executor.getQueue(); queue.setCapacity(parameter.getCapacity()); } else { log.warn("The queue length cannot be modified. Queue type mismatch. Current queue type :: {}", executor.getQueue().getClass().getSimpleName()); diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/MonitorPerformanceTest.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/MonitorPerformanceTest.java index a4b18134..a1284a49 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/MonitorPerformanceTest.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/MonitorPerformanceTest.java @@ -4,7 +4,7 @@ import cn.hippo4j.common.model.PoolRunStateInfo; import cn.hippo4j.common.toolkit.JSONUtil; import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; import cn.hippo4j.starter.monitor.collect.RunTimeInfoCollector; -import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockIngQueue; +import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockingQueue; import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; import cn.hippo4j.core.executor.support.ThreadPoolBuilder; import cn.hippo4j.common.toolkit.ThreadUtil; @@ -34,7 +34,7 @@ public class MonitorPerformanceTest { .dynamicPool() .threadFactory(TEST_FLAG) .poolThreadSize(5, 10) - .workQueue(new ResizableCapacityLinkedBlockIngQueue(1024)) + .workQueue(new ResizableCapacityLinkedBlockingQueue(1024)) .rejected(new ThreadPoolExecutor.AbortPolicy()) .build(); @@ -42,7 +42,7 @@ public class MonitorPerformanceTest { .dynamicPool() .threadFactory("dynamic.thread.pool") .poolThreadSize(5, 10) - .workQueue(new ResizableCapacityLinkedBlockIngQueue(1024)) + .workQueue(new ResizableCapacityLinkedBlockingQueue(1024)) .rejected(new ThreadPoolExecutor.AbortPolicy()) .build(); diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java index 466c2259..c2c7c2bd 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java @@ -1,6 +1,6 @@ package cn.hippo4j.starter.test; -import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockIngQueue; +import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockingQueue; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.LinkedBlockingQueue; @@ -17,7 +17,7 @@ import java.util.concurrent.TimeUnit; public class ResizableCapacityLinkedBlockIngQueueTest { public static void main(String[] args) throws InterruptedException { - ResizableCapacityLinkedBlockIngQueue blockIngQueue = new ResizableCapacityLinkedBlockIngQueue(5); + ResizableCapacityLinkedBlockingQueue blockIngQueue = new ResizableCapacityLinkedBlockingQueue(5); ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 3, 1024,