抽象模块 hippo4j-core.

pull/110/head
chen.ma 3 years ago
parent 227f8893e0
commit 4ae492c8b0

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-all</artifactId>
<version>${revision}</version>
</parent>
<artifactId>hippo4j-core</artifactId>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-common</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Implementation-Title>${project.artifactId}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Build-Time>${maven.build.timestamp}</Build-Time>
<Built-By>chen.ma</Built-By>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -1,13 +1,14 @@
package cn.hippo4j.starter.core;
package cn.hippo4j.core.executor;
import cn.hippo4j.core.executor.support.AbstractDynamicExecutorSupport;
import cn.hippo4j.core.proxy.RejectedProxyUtil;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import org.springframework.core.task.TaskDecorator;
import java.lang.reflect.Proxy;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
/**
* Dynamic threadPool wrap.
@ -15,16 +16,21 @@ import java.util.concurrent.atomic.AtomicInteger;
* @author chen.ma
* @date 2021/7/8 21:47
*/
public class DynamicThreadPoolExecutor extends DynamicExecutorConfigurationSupport {
public class DynamicThreadPoolExecutor extends AbstractDynamicExecutorSupport {
@Getter
@Setter
private TaskDecorator taskDecorator;
@Getter
@Setter
private RejectedExecutionHandler redundancyHandler;
@Getter
private final String threadPoolId;
private final AtomicInteger rejectCount = new AtomicInteger();
@Getter
private final AtomicLong rejectCount = new AtomicLong();
public DynamicThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
@ -39,12 +45,12 @@ public class DynamicThreadPoolExecutor extends DynamicExecutorConfigurationSuppo
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, waitForTasksToCompleteOnShutdown, awaitTerminationMillis, workQueue, threadPoolId, threadFactory, handler);
this.threadPoolId = threadPoolId;
RejectedExecutionHandler rejectedProxy = (RejectedExecutionHandler) Proxy
.newProxyInstance(
handler.getClass().getClassLoader(),
new Class[]{RejectedExecutionHandler.class},
new RejectedProxyInvocationHandler(handler, rejectCount));
// Number of dynamic proxy denial policies.
RejectedExecutionHandler rejectedProxy = RejectedProxyUtil.createProxy(handler, rejectCount);
setRejectedExecutionHandler(rejectedProxy);
// Redundant fields to avoid reflecting the acquired fields when sending change information.
redundancyHandler = handler;
}
@Override
@ -66,7 +72,7 @@ public class DynamicThreadPoolExecutor extends DynamicExecutorConfigurationSuppo
*
* @return
*/
public Integer getRejectCount() {
public Long getRejectCountNum() {
return rejectCount.get();
}

@ -1,7 +1,7 @@
package cn.hippo4j.starter.wrapper;
package cn.hippo4j.core.executor;
import cn.hippo4j.starter.common.CommonDynamicThreadPool;
import cn.hippo4j.starter.core.DynamicExecutorConfigurationSupport;
import cn.hippo4j.core.executor.support.AbstractDynamicExecutorSupport;
import cn.hippo4j.core.executor.support.CommonDynamicThreadPool;
import lombok.Data;
import org.springframework.beans.factory.DisposableBean;
@ -40,7 +40,7 @@ public class DynamicThreadPoolWrapper implements DisposableBean {
/**
* executor
* {@link cn.hippo4j.starter.core.DynamicThreadPoolExecutor}
* {@link DynamicThreadPoolExecutor}
*/
private ThreadPoolExecutor executor;
@ -96,8 +96,8 @@ public class DynamicThreadPoolWrapper implements DisposableBean {
@Override
public void destroy() throws Exception {
if (executor != null && executor instanceof DynamicExecutorConfigurationSupport) {
((DynamicExecutorConfigurationSupport) executor).destroy();
if (executor != null && executor instanceof AbstractDynamicExecutorSupport) {
((AbstractDynamicExecutorSupport) executor).destroy();
}
}

@ -1,7 +1,7 @@
package cn.hippo4j.starter.core;
package cn.hippo4j.core.executor.manage;
import cn.hippo4j.common.model.PoolParameter;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import com.google.common.collect.Lists;
import java.util.List;

@ -1,7 +1,7 @@
package cn.hippo4j.starter.toolkit.thread;
package cn.hippo4j.core.executor.support;
import cn.hippo4j.common.toolkit.Assert;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
@ -210,3 +210,4 @@ public class AbstractBuildThreadPoolTemplate {
}
}

@ -1,4 +1,4 @@
package cn.hippo4j.starter.core;
package cn.hippo4j.core.executor.support;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
@ -13,27 +13,27 @@ import java.util.concurrent.*;
* @date 2021/11/28 12:17
*/
@Slf4j
public abstract class DynamicExecutorConfigurationSupport extends ThreadPoolExecutor
public abstract class AbstractDynamicExecutorSupport extends ThreadPoolExecutor
implements InitializingBean, DisposableBean {
private String threadPoolId;
private ExecutorService executor;
protected long awaitTerminationMillis;
public long awaitTerminationMillis;
protected boolean waitForTasksToCompleteOnShutdown;
public boolean waitForTasksToCompleteOnShutdown;
public DynamicExecutorConfigurationSupport(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
boolean waitForTasksToCompleteOnShutdown,
long awaitTerminationMillis,
BlockingQueue<Runnable> workQueue,
String threadPoolId,
ThreadFactory threadFactory,
RejectedExecutionHandler handler) {
public AbstractDynamicExecutorSupport(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
boolean waitForTasksToCompleteOnShutdown,
long awaitTerminationMillis,
BlockingQueue<Runnable> workQueue,
String threadPoolId,
ThreadFactory threadFactory,
RejectedExecutionHandler handler) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler);
this.threadPoolId = threadPoolId;
this.waitForTasksToCompleteOnShutdown = waitForTasksToCompleteOnShutdown;

@ -1,8 +1,6 @@
package cn.hippo4j.starter.common;
package cn.hippo4j.core.executor.support;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.toolkit.thread.QueueTypeEnum;
import cn.hippo4j.starter.toolkit.thread.ThreadPoolBuilder;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@ -1,7 +1,7 @@
package cn.hippo4j.starter.toolkit.thread;
package cn.hippo4j.core.executor.support;
import cn.hippo4j.starter.spi.DynamicTpServiceLoader;
import cn.hippo4j.starter.spi.CustomBlockingQueue;
import cn.hippo4j.core.spi.DynamicThreadPoolServiceLoader;
import cn.hippo4j.core.spi.CustomBlockingQueue;
import java.util.Arrays;
import java.util.Collection;
@ -62,9 +62,16 @@ public enum QueueTypeEnum {
}
static {
DynamicTpServiceLoader.register(CustomBlockingQueue.class);
DynamicThreadPoolServiceLoader.register(CustomBlockingQueue.class);
}
/**
* Create blocking queue.
*
* @param type
* @param capacity
* @return
*/
public static BlockingQueue createBlockingQueue(int type, Integer capacity) {
BlockingQueue blockingQueue = null;
if (Objects.equals(type, ARRAY_BLOCKING_QUEUE.type)) {
@ -83,7 +90,7 @@ public enum QueueTypeEnum {
blockingQueue = new ResizableCapacityLinkedBlockIngQueue(capacity);
}
Collection<CustomBlockingQueue> customBlockingQueues = DynamicTpServiceLoader
Collection<CustomBlockingQueue> customBlockingQueues = DynamicThreadPoolServiceLoader
.getSingletonServiceInstances(CustomBlockingQueue.class);
blockingQueue = Optional.ofNullable(blockingQueue).orElseGet(() -> customBlockingQueues.stream()
.filter(each -> Objects.equals(type, each.getType()))
@ -94,6 +101,12 @@ public enum QueueTypeEnum {
return blockingQueue;
}
/**
* Get blocking queue name by type.
*
* @param type
* @return
*/
public static String getBlockingQueueNameByType(int type) {
Optional<QueueTypeEnum> queueTypeEnum = Arrays.stream(QueueTypeEnum.values())
.filter(each -> each.type == type)

@ -1,7 +1,7 @@
package cn.hippo4j.starter.toolkit.thread;
package cn.hippo4j.core.executor.support;
import cn.hippo4j.starter.spi.CustomRejectedExecutionHandler;
import cn.hippo4j.starter.spi.DynamicTpServiceLoader;
import cn.hippo4j.core.spi.CustomRejectedExecutionHandler;
import cn.hippo4j.core.spi.DynamicThreadPoolServiceLoader;
import java.util.Collection;
import java.util.Objects;
@ -64,9 +64,15 @@ public enum RejectedTypeEnum {
}
static {
DynamicTpServiceLoader.register(CustomRejectedExecutionHandler.class);
DynamicThreadPoolServiceLoader.register(CustomRejectedExecutionHandler.class);
}
/**
* Create policy.
*
* @param type
* @return
*/
public static RejectedExecutionHandler createPolicy(int type) {
Optional<RejectedExecutionHandler> rejectedTypeEnum = Stream.of(RejectedTypeEnum.values())
.filter(each -> Objects.equals(type, each.type))
@ -75,7 +81,7 @@ public enum RejectedTypeEnum {
// 使用 SPI 匹配拒绝策略
RejectedExecutionHandler resultRejected = rejectedTypeEnum.orElseGet(() -> {
Collection<CustomRejectedExecutionHandler> customRejectedExecutionHandlers = DynamicTpServiceLoader
Collection<CustomRejectedExecutionHandler> customRejectedExecutionHandlers = DynamicThreadPoolServiceLoader
.getSingletonServiceInstances(CustomRejectedExecutionHandler.class);
Optional<RejectedExecutionHandler> customRejected = customRejectedExecutionHandlers.stream()
.filter(each -> Objects.equals(type, each.getType()))
@ -88,6 +94,12 @@ public enum RejectedTypeEnum {
return resultRejected;
}
/**
* Get rejected name by type.
*
* @param type
* @return
*/
public static String getRejectedNameByType(int type) {
return createPolicy(type).getClass().getSimpleName();
}

@ -1,4 +1,4 @@
package cn.hippo4j.starter.toolkit.thread;
package cn.hippo4j.core.executor.support;
import cn.hutool.core.util.ReflectUtil;
import lombok.extern.slf4j.Slf4j;
@ -34,7 +34,6 @@ public class ResizableCapacityLinkedBlockIngQueue<E> extends LinkedBlockingQueue
ReflectUtil.invoke(this, "signalNotFull");
}
} catch (Exception ex) {
// ignore
log.error("Dynamic modification of blocking queue size failed.", ex);
successFlag = false;
}

@ -1,4 +1,4 @@
package cn.hippo4j.starter.toolkit.thread;
package cn.hippo4j.core.executor.support;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.RejectedExecutionException;

@ -1,4 +1,4 @@
package cn.hippo4j.starter.toolkit.thread;
package cn.hippo4j.core.executor.support;
import cn.hippo4j.common.design.builder.Builder;
import cn.hippo4j.common.toolkit.Assert;

@ -1,6 +1,7 @@
package cn.hippo4j.starter.toolkit.thread;
package cn.hippo4j.core.executor.support;
import cn.hippo4j.starter.toolkit.ArrayUtil;
import cn.hippo4j.common.toolkit.ArrayUtil;
import java.util.concurrent.*;

@ -1,11 +1,11 @@
package cn.hippo4j.starter.core;
package cn.hippo4j.core.proxy;
import lombok.AllArgsConstructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
/**
* Rejected proxy invocation handler.
@ -18,7 +18,7 @@ public class RejectedProxyInvocationHandler implements InvocationHandler {
private final Object target;
private final AtomicInteger rejectCount;
private final AtomicLong rejectCount;
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

@ -0,0 +1,33 @@
package cn.hippo4j.core.proxy;
import java.lang.reflect.Proxy;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.atomic.AtomicLong;
/**
* Rejected proxy util.
*
* @author chen.ma
* @date 2022/2/22 21:56
*/
public class RejectedProxyUtil {
/**
* Proxy rejected execution.
*
* @param rejectedExecutionHandler
* @param rejectedNum
* @return
*/
public static RejectedExecutionHandler createProxy(RejectedExecutionHandler rejectedExecutionHandler, AtomicLong rejectedNum) {
RejectedExecutionHandler rejectedProxy = (RejectedExecutionHandler) Proxy
.newProxyInstance(
rejectedExecutionHandler.getClass().getClassLoader(),
new Class[]{RejectedExecutionHandler.class},
new RejectedProxyInvocationHandler(rejectedExecutionHandler, rejectedNum)
);
return rejectedProxy;
}
}

@ -1,17 +1,22 @@
package cn.hippo4j.starter.core;
package cn.hippo4j.core.refresh;
import cn.hippo4j.common.enums.EnableEnum;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.starter.alarm.ThreadPoolAlarmManage;
import cn.hippo4j.starter.toolkit.thread.QueueTypeEnum;
import cn.hippo4j.starter.toolkit.thread.RejectedTypeEnum;
import cn.hippo4j.starter.toolkit.thread.ResizableCapacityLinkedBlockIngQueue;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
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.proxy.RejectedProxyUtil;
import lombok.extern.slf4j.Slf4j;
import java.util.Objects;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
/**
* ThreadPool dynamic refresh.
@ -24,7 +29,8 @@ public class ThreadPoolDynamicRefresh {
public static void refreshDynamicPool(String content) {
PoolParameterInfo parameter = JSONUtil.parseObject(content, PoolParameterInfo.class);
ThreadPoolAlarmManage.sendPoolConfigChange(parameter);
// TODO 抽象报警通知模块
// ThreadPoolAlarmManage.sendPoolConfigChange(parameter);
ThreadPoolDynamicRefresh.refreshDynamicPool(parameter);
}
@ -37,14 +43,28 @@ public class ThreadPoolDynamicRefresh {
String originalQuery = executor.getQueue().getClass().getSimpleName();
int originalCapacity = executor.getQueue().remainingCapacity() + executor.getQueue().size();
long originalKeepAliveTime = executor.getKeepAliveTime(TimeUnit.SECONDS);
String originalRejected = executor.getRejectedExecutionHandler().getClass().getSimpleName();
boolean originalAllowCoreThreadTimeOut = executor.allowsCoreThreadTimeOut();
String originalRejected;
RejectedExecutionHandler rejectedExecutionHandler = executor.getRejectedExecutionHandler();
if (executor instanceof AbstractDynamicExecutorSupport) {
DynamicThreadPoolExecutor dynamicExecutor = (DynamicThreadPoolExecutor) executor;
rejectedExecutionHandler = dynamicExecutor.getRedundancyHandler();
}
originalRejected = rejectedExecutionHandler.getClass().getSimpleName();
changePoolInfo(executor, parameter);
ThreadPoolExecutor afterExecutor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor();
log.info(
"[🔥 {}] Changed thread pool. \ncoreSize :: [{}], maxSize :: [{}], queueType :: [{}], capacity :: [{}], keepAliveTime :: [{}], rejectedType :: [{}], allowCoreThreadTimeOut :: [{}]",
"[🔥 {}] Changed thread pool. " +
"\n coreSize :: [{}]" +
"\n maxSize :: [{}]" +
"\n queueType :: [{}]" +
"\n capacity :: [{}]" +
"\n keepAliveTime :: [{}]" +
"\n rejectedType :: [{}]" +
"\n allowCoreThreadTimeOut :: [{}]",
threadPoolId.toUpperCase(),
String.format("%s => %s", originalCoreSize, afterExecutor.getCorePoolSize()),
String.format("%s => %s", originalMaximumPoolSize, afterExecutor.getMaximumPoolSize()),
@ -81,7 +101,15 @@ public class ThreadPoolDynamicRefresh {
}
if (parameter.getRejectedType() != null) {
executor.setRejectedExecutionHandler(RejectedTypeEnum.createPolicy(parameter.getRejectedType()));
RejectedExecutionHandler rejectedExecutionHandler = RejectedTypeEnum.createPolicy(parameter.getRejectedType());
if (executor instanceof AbstractDynamicExecutorSupport) {
DynamicThreadPoolExecutor dynamicExecutor = (DynamicThreadPoolExecutor) executor;
dynamicExecutor.setRedundancyHandler(rejectedExecutionHandler);
AtomicLong rejectCount = dynamicExecutor.getRejectCount();
rejectedExecutionHandler = RejectedProxyUtil.createProxy(rejectedExecutionHandler, rejectCount);
}
executor.setRejectedExecutionHandler(rejectedExecutionHandler);
}
if (parameter.getAllowCoreThreadTimeOut() != null) {

@ -1,4 +1,4 @@
package cn.hippo4j.starter.spi;
package cn.hippo4j.core.spi;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@ -10,16 +10,28 @@ import java.util.stream.Collectors;
* @author chen.ma
* @date 2021/7/10 23:45
*/
public class DynamicTpServiceLoader {
public class DynamicThreadPoolServiceLoader {
private static final Map<Class<?>, Collection<Object>> SERVICES = new ConcurrentHashMap();
/**
* Register.
*
* @param serviceInterface
*/
public static void register(final Class<?> serviceInterface) {
if (!SERVICES.containsKey(serviceInterface)) {
SERVICES.put(serviceInterface, load(serviceInterface));
}
}
/**
* Load.
*
* @param serviceInterface
* @param <T>
* @return
*/
private static <T> Collection<Object> load(final Class<T> serviceInterface) {
Collection<Object> result = new LinkedList<>();
for (T each : ServiceLoader.load(serviceInterface)) {
@ -28,14 +40,34 @@ public class DynamicTpServiceLoader {
return result;
}
/**
* Get singleton service instances.
*
* @param service
* @param <T>
* @return
*/
public static <T> Collection<T> getSingletonServiceInstances(final Class<T> service) {
return (Collection<T>) SERVICES.getOrDefault(service, Collections.emptyList());
}
/**
* New service instances.
*
* @param service
* @param <T>
* @return
*/
public static <T> Collection<T> newServiceInstances(final Class<T> service) {
return SERVICES.containsKey(service) ? SERVICES.get(service).stream().map(each -> (T) newServiceInstance(each.getClass())).collect(Collectors.toList()) : Collections.emptyList();
}
/**
* New service instance.
*
* @param clazz
* @return
*/
private static Object newServiceInstance(final Class<?> clazz) {
try {
return clazz.newInstance();

@ -2,12 +2,15 @@ package cn.hippo4j.starter.alarm;
import cn.hippo4j.common.config.ApplicationContextHolder;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.common.notify.AlarmControlDTO;
import cn.hippo4j.common.notify.AlarmControlHandler;
import cn.hippo4j.common.notify.NotifyTypeEnum;
import cn.hippo4j.common.toolkit.GroupKey;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.common.web.base.Result;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.starter.config.BootstrapProperties;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.starter.remote.HttpAgent;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
@ -49,7 +52,7 @@ public class BaseSendMessageService implements InitializingBean, SendMessageServ
private final Map<String, SendMessageHandler> sendMessageHandlers = Maps.newHashMap();
@Override
public void sendAlarmMessage(MessageTypeEnum typeEnum, DynamicThreadPoolExecutor executor) {
public void sendAlarmMessage(NotifyTypeEnum typeEnum, DynamicThreadPoolExecutor executor) {
String threadPoolId = executor.getThreadPoolId();
String buildKey = StrUtil.builder(executor.getThreadPoolId(), "+", "ALARM").toString();
List<NotifyDTO> notifyList = ALARM_NOTIFY_CONFIG.get(buildKey);

@ -1,5 +1,6 @@
package cn.hippo4j.starter.alarm;
import cn.hippo4j.common.notify.NotifyTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;
@ -56,6 +57,6 @@ public class NotifyDTO {
/**
*
*/
private MessageTypeEnum typeEnum;
private NotifyTypeEnum typeEnum;
}

@ -1,7 +1,7 @@
package cn.hippo4j.starter.alarm;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
/**
* Send message handler.

@ -1,7 +1,8 @@
package cn.hippo4j.starter.alarm;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.common.notify.NotifyTypeEnum;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
/**
* Send msg.
@ -17,7 +18,7 @@ public interface SendMessageService {
* @param typeEnum
* @param threadPoolExecutor
*/
void sendAlarmMessage(MessageTypeEnum typeEnum, DynamicThreadPoolExecutor threadPoolExecutor);
void sendAlarmMessage(NotifyTypeEnum typeEnum, DynamicThreadPoolExecutor threadPoolExecutor);
/**
* Send change message.

@ -2,8 +2,9 @@ package cn.hippo4j.starter.alarm;
import cn.hippo4j.common.config.ApplicationContextHolder;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.common.notify.NotifyTypeEnum;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.config.MessageAlarmConfiguration;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.toolkit.CalculateUtil;
import lombok.extern.slf4j.Slf4j;
@ -54,7 +55,7 @@ public class ThreadPoolAlarmManage {
&& divide > threadPoolAlarm.getCapacityAlarm()
&& isSendMessage(threadPoolExecutor, MessageTypeEnum.CAPACITY);
if (isSend) {
SEND_MESSAGE_SERVICE.sendAlarmMessage(MessageTypeEnum.CAPACITY, threadPoolExecutor);
SEND_MESSAGE_SERVICE.sendAlarmMessage(NotifyTypeEnum.CAPACITY, threadPoolExecutor);
}
}
@ -81,7 +82,7 @@ public class ThreadPoolAlarmManage {
&& divide > threadPoolAlarm.getLivenessAlarm()
&& isSendMessage(threadPoolExecutor, MessageTypeEnum.LIVENESS);
if (isSend) {
SEND_MESSAGE_SERVICE.sendAlarmMessage(MessageTypeEnum.LIVENESS, threadPoolExecutor);
SEND_MESSAGE_SERVICE.sendAlarmMessage(NotifyTypeEnum.ACTIVITY, threadPoolExecutor);
}
}
@ -101,7 +102,7 @@ public class ThreadPoolAlarmManage {
*/
ThreadPoolAlarm threadPoolAlarm = new ThreadPoolAlarm(null, 80, 80);
if (threadPoolAlarm.getIsAlarm() && isSendMessage(threadPoolExecutor, MessageTypeEnum.REJECT)) {
SEND_MESSAGE_SERVICE.sendAlarmMessage(MessageTypeEnum.REJECT, threadPoolExecutor);
SEND_MESSAGE_SERVICE.sendAlarmMessage(NotifyTypeEnum.REJECT, threadPoolExecutor);
}
}

@ -4,13 +4,13 @@ import cn.hippo4j.common.enums.EnableEnum;
import cn.hippo4j.common.model.InstanceInfo;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.starter.alarm.NotifyDTO;
import cn.hippo4j.starter.alarm.NotifyPlatformEnum;
import cn.hippo4j.common.notify.NotifyPlatformEnum;
import cn.hippo4j.starter.alarm.SendMessageHandler;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.starter.toolkit.thread.QueueTypeEnum;
import cn.hippo4j.starter.toolkit.thread.RejectedTypeEnum;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.support.QueueTypeEnum;
import cn.hippo4j.core.executor.support.RejectedTypeEnum;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import cn.hutool.core.date.DateUtil;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
@ -98,7 +98,7 @@ public class DingSendMessageHandler implements SendMessageHandler {
// 拒绝策略名称
pool.getRejectedExecutionHandler().getClass().getSimpleName(),
// 拒绝策略次数
pool.getRejectCount(),
pool.getRejectCountNum(),
// 告警手机号
afterReceives,
// 报警频率

@ -5,13 +5,13 @@ import cn.hippo4j.common.model.InstanceInfo;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.common.toolkit.StringUtil;
import cn.hippo4j.starter.alarm.NotifyDTO;
import cn.hippo4j.starter.alarm.NotifyPlatformEnum;
import cn.hippo4j.common.notify.NotifyPlatformEnum;
import cn.hippo4j.starter.alarm.SendMessageHandler;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.starter.toolkit.thread.QueueTypeEnum;
import cn.hippo4j.starter.toolkit.thread.RejectedTypeEnum;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.support.QueueTypeEnum;
import cn.hippo4j.core.executor.support.RejectedTypeEnum;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
@ -105,7 +105,7 @@ public class LarkSendMessageHandler implements SendMessageHandler {
// 拒绝策略名称
pool.getRejectedExecutionHandler().getClass().getSimpleName(),
// 拒绝策略次数
pool.getRejectCount(),
pool.getRejectCountNum(),
// 告警姓名
afterReceives,
// 当前时间

@ -5,13 +5,13 @@ import cn.hippo4j.common.model.InstanceInfo;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.starter.alarm.NotifyDTO;
import cn.hippo4j.starter.alarm.NotifyPlatformEnum;
import cn.hippo4j.common.notify.NotifyPlatformEnum;
import cn.hippo4j.starter.alarm.SendMessageHandler;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.starter.toolkit.thread.QueueTypeEnum;
import cn.hippo4j.starter.toolkit.thread.RejectedTypeEnum;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.support.QueueTypeEnum;
import cn.hippo4j.core.executor.support.RejectedTypeEnum;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpRequest;
import com.google.common.base.Joiner;
@ -86,7 +86,7 @@ public class WeChatSendMessageHandler implements SendMessageHandler {
// 拒绝策略名称
pool.getRejectedExecutionHandler().getClass().getSimpleName(),
// 拒绝策略次数
pool.getRejectCount(),
pool.getRejectCountNum(),
// 告警手机号
afterReceives,
// 报警频率

@ -1,7 +1,7 @@
package cn.hippo4j.starter.config;
import cn.hippo4j.common.model.InstanceInfo;
import cn.hippo4j.starter.alarm.AlarmControlHandler;
import cn.hippo4j.common.notify.AlarmControlHandler;
import cn.hippo4j.starter.alarm.BaseSendMessageService;
import cn.hippo4j.starter.alarm.SendMessageHandler;
import cn.hippo4j.starter.alarm.SendMessageService;

@ -1,5 +1,6 @@
package cn.hippo4j.starter.core;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.starter.wrapper.ManagerListenerWrapper;
import cn.hippo4j.common.toolkit.ContentUtil;
import cn.hippo4j.common.toolkit.Md5Util;

@ -7,7 +7,7 @@ import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.common.web.base.Result;
import cn.hippo4j.starter.remote.HttpAgent;
import cn.hippo4j.starter.remote.ServerHealthCheck;
import cn.hippo4j.starter.toolkit.thread.ThreadFactoryBuilder;
import cn.hippo4j.core.executor.support.ThreadFactoryBuilder;
import cn.hutool.core.util.IdUtil;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;

@ -1,5 +1,7 @@
package cn.hippo4j.starter.core;
import cn.hippo4j.core.refresh.ThreadPoolDynamicRefresh;
/**
* Config adapter.
*

@ -7,7 +7,7 @@ import cn.hippo4j.common.web.base.Result;
import cn.hippo4j.common.web.base.Results;
import cn.hippo4j.common.web.exception.ErrorCodeEnum;
import cn.hippo4j.starter.remote.HttpAgent;
import cn.hippo4j.starter.toolkit.thread.ThreadFactoryBuilder;
import cn.hippo4j.core.executor.support.ThreadFactoryBuilder;
import cn.hutool.core.text.StrBuilder;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;

@ -6,14 +6,14 @@ import cn.hippo4j.common.enums.EnableEnum;
import cn.hippo4j.common.model.PoolParameterInfo;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.common.web.base.Result;
import cn.hippo4j.starter.common.CommonDynamicThreadPool;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.refresh.ThreadPoolDynamicRefresh;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.support.*;
import cn.hippo4j.starter.config.BootstrapProperties;
import cn.hippo4j.starter.remote.HttpAgent;
import cn.hippo4j.starter.toolkit.DynamicThreadPoolAnnotationUtil;
import cn.hippo4j.starter.toolkit.thread.QueueTypeEnum;
import cn.hippo4j.starter.toolkit.thread.RejectedTypeEnum;
import cn.hippo4j.starter.toolkit.thread.ThreadPoolBuilder;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
@ -142,7 +142,7 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor {
.build();
// 设置动态线程池增强参数
if (dynamicThreadPoolWrap.getExecutor() instanceof DynamicExecutorConfigurationSupport) {
if (dynamicThreadPoolWrap.getExecutor() instanceof AbstractDynamicExecutorSupport) {
TaskDecorator taskDecorator = ((DynamicThreadPoolExecutor) dynamicThreadPoolWrap.getExecutor()).getTaskDecorator();
((DynamicThreadPoolExecutor) newDynamicPoolExecutor).setTaskDecorator(taskDecorator);

@ -1,8 +1,8 @@
package cn.hippo4j.starter.event;
import cn.hippo4j.common.function.NoArgsConsumer;
import cn.hippo4j.starter.toolkit.thread.QueueTypeEnum;
import cn.hippo4j.starter.toolkit.thread.ThreadPoolBuilder;
import cn.hippo4j.core.executor.support.QueueTypeEnum;
import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.ExecutorService;

@ -2,10 +2,10 @@ package cn.hippo4j.starter.handler;
import cn.hippo4j.common.model.PoolBaseInfo;
import cn.hippo4j.common.model.PoolRunStateInfo;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.starter.toolkit.CalculateUtil;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
@ -103,9 +103,9 @@ public abstract class AbstractThreadPoolRuntime {
stateInfo.setLargestPoolSize(largestPoolSize);
stateInfo.setCompletedTaskCount(completedTaskCount);
int rejectCount = pool instanceof DynamicThreadPoolExecutor
? ((DynamicThreadPoolExecutor) pool).getRejectCount()
: -1;
long rejectCount = pool instanceof DynamicThreadPoolExecutor
? ((DynamicThreadPoolExecutor) pool).getRejectCountNum()
: -1L;
stateInfo.setRejectCount(rejectCount);
stateInfo.setClientLastRefreshTime(DateUtil.formatDateTime(new Date()));
stateInfo.setTimestamp(System.currentTimeMillis());

@ -4,8 +4,8 @@ import cn.hippo4j.common.api.ThreadDetailState;
import cn.hippo4j.common.model.ThreadDetailStateInfo;
import cn.hippo4j.common.toolkit.CollectionUtil;
import cn.hippo4j.common.toolkit.ReflectUtil;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;

@ -2,10 +2,12 @@ package cn.hippo4j.starter.handler;
import cn.hippo4j.common.model.ManyPoolRunStateInfo;
import cn.hippo4j.common.model.PoolRunStateInfo;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.support.AbstractDynamicExecutorSupport;
import cn.hippo4j.starter.toolkit.ByteConvertUtil;
import cn.hippo4j.starter.toolkit.inet.InetUtils;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.system.RuntimeInfo;
@ -53,7 +55,13 @@ public class ThreadPoolRunStateHandler extends AbstractThreadPoolRuntime {
String threadPoolId = poolRunStateInfo.getTpId();
DynamicThreadPoolWrapper executorService = GlobalThreadPoolManage.getExecutorService(threadPoolId);
ThreadPoolExecutor pool = executorService.getExecutor();
String rejectedName = pool.getRejectedExecutionHandler().getClass().getSimpleName();
String rejectedName;
if (pool instanceof AbstractDynamicExecutorSupport) {
rejectedName = ((DynamicThreadPoolExecutor) pool).getRedundancyHandler().getClass().getSimpleName();
} else {
rejectedName = pool.getRejectedExecutionHandler().getClass().getSimpleName();
}
poolRunStateInfo.setRejectedName(rejectedName);
ManyPoolRunStateInfo manyPoolRunStateInfo = BeanUtil.toBean(poolRunStateInfo, ManyPoolRunStateInfo.class);

@ -6,8 +6,8 @@ import cn.hippo4j.starter.config.BootstrapProperties;
import cn.hippo4j.starter.monitor.collect.Collector;
import cn.hippo4j.starter.monitor.send.MessageSender;
import cn.hippo4j.starter.remote.ServerHealthCheck;
import cn.hippo4j.starter.toolkit.thread.ThreadFactoryBuilder;
import cn.hippo4j.starter.toolkit.thread.ThreadUtil;
import cn.hippo4j.core.executor.support.ThreadFactoryBuilder;
import cn.hippo4j.common.toolkit.ThreadUtil;
import cn.hutool.core.collection.CollUtil;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
@ -23,7 +23,7 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import static cn.hippo4j.starter.core.GlobalThreadPoolManage.getThreadPoolNum;
import static cn.hippo4j.core.executor.manage.GlobalThreadPoolManage.getThreadPoolNum;
/**
* 线.

@ -6,7 +6,7 @@ import cn.hippo4j.common.monitor.Message;
import cn.hippo4j.common.monitor.MessageTypeEnum;
import cn.hippo4j.common.monitor.RuntimeMessage;
import cn.hippo4j.starter.config.BootstrapProperties;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.starter.handler.AbstractThreadPoolRuntime;
import cn.hutool.core.bean.BeanUtil;
import com.google.common.collect.Lists;

@ -2,7 +2,7 @@ package cn.hippo4j.starter.remote;
import cn.hippo4j.starter.core.ShutdownExecuteException;
import cn.hippo4j.starter.event.ApplicationCompleteEvent;
import cn.hippo4j.starter.toolkit.thread.ThreadFactoryBuilder;
import cn.hippo4j.core.executor.support.ThreadFactoryBuilder;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;

@ -6,7 +6,7 @@ import cn.hippo4j.common.web.base.Result;
import cn.hippo4j.starter.config.BootstrapProperties;
import cn.hippo4j.starter.security.SecurityProxy;
import cn.hippo4j.starter.toolkit.HttpClientUtil;
import cn.hippo4j.starter.toolkit.thread.ThreadFactoryBuilder;
import cn.hippo4j.core.executor.support.ThreadFactoryBuilder;
import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Maps;

@ -1,42 +0,0 @@
package cn.hippo4j.starter.toolkit;
import java.lang.reflect.Array;
/**
* Array util.
*
* @author chen.ma
* @date 2021/7/5 21:54
*/
public class ArrayUtil {
public static <T> T[] addAll(final T[] array1, @SuppressWarnings("unchecked") final T... array2) {
if (array1 == null) {
return clone(array2);
} else if (array2 == null) {
return clone(array1);
}
final Class<?> type1 = array1.getClass().getComponentType();
@SuppressWarnings("unchecked") final T[] joinedArray = (T[]) Array.newInstance(type1, array1.length + array2.length);
System.arraycopy(array1, 0, joinedArray, 0, array1.length);
try {
System.arraycopy(array2, 0, joinedArray, array1.length, array2.length);
} catch (final ArrayStoreException ase) {
final Class<?> type2 = array2.getClass().getComponentType();
if (!type1.isAssignableFrom(type2)) {
throw new IllegalArgumentException("Cannot store " + type2.getName() + " in an array of "
+ type1.getName(), ase);
}
throw ase;
}
return joinedArray;
}
public static <T> T[] clone(final T[] array) {
if (array == null) {
return null;
}
return array.clone();
}
}

@ -1,6 +1,6 @@
package cn.hippo4j.starter.toolkit.inet;
import cn.hippo4j.starter.toolkit.thread.ThreadPoolBuilder;
import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@ -1,43 +0,0 @@
package cn.hippo4j.starter.toolkit.thread;
/**
* Thread util.
*
* @author chen.ma
* @date 2021/12/6 23:34
*/
public class ThreadUtil {
/**
* 线.
*
* @param runnable {@link Runnable}
* @param name 线
* @param isDaemon 线
* @return {@link Thread}
*/
public static Thread newThread(Runnable runnable, String name, boolean isDaemon) {
Thread t = new Thread(null, runnable, name);
t.setDaemon(isDaemon);
return t;
}
/**
* 线.
*
* @param millis
* @return
*/
public static boolean sleep(long millis) {
if (millis > 0) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
return false;
}
}
return true;
}
}

@ -2,13 +2,13 @@ package cn.hippo4j.starter.test;
import cn.hippo4j.common.model.PoolRunStateInfo;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.starter.core.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.starter.monitor.collect.RunTimeInfoCollector;
import cn.hippo4j.starter.toolkit.thread.ResizableCapacityLinkedBlockIngQueue;
import cn.hippo4j.starter.toolkit.thread.ThreadFactoryBuilder;
import cn.hippo4j.starter.toolkit.thread.ThreadPoolBuilder;
import cn.hippo4j.starter.toolkit.thread.ThreadUtil;
import cn.hippo4j.starter.wrapper.DynamicThreadPoolWrapper;
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;
import cn.hippo4j.core.executor.DynamicThreadPoolWrapper;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.ScheduledThreadPoolExecutor;

@ -1,8 +1,8 @@
package cn.hippo4j.starter.test;
import cn.hippo4j.starter.core.DynamicThreadPoolExecutor;
import cn.hippo4j.starter.toolkit.thread.ThreadPoolBuilder;
import cn.hippo4j.starter.toolkit.thread.ThreadUtil;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
import cn.hippo4j.common.toolkit.ThreadUtil;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.LinkedBlockingQueue;
@ -44,7 +44,7 @@ public class RejectedExecutionHandlerProxyTest {
ThreadUtil.sleep(1000);
DynamicThreadPoolExecutor dynamicThreadPoolExecutor = (DynamicThreadPoolExecutor) executor;
Integer rejectCount = dynamicThreadPoolExecutor.getRejectCount();
long rejectCount = dynamicThreadPoolExecutor.getRejectCountNum();
log.info("ThreadPool name :: {}, Reject count :: {}", Thread.currentThread().getName(), rejectCount);
}
}

@ -1,6 +1,6 @@
package cn.hippo4j.starter.test;
import cn.hippo4j.starter.toolkit.thread.ResizableCapacityLinkedBlockIngQueue;
import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockIngQueue;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.LinkedBlockingQueue;

Loading…
Cancel
Save