diff --git a/jcommon/rcurve/pom.xml b/jcommon/rcurve/pom.xml index 8b447d0ad..dc790a1ed 100644 --- a/jcommon/rcurve/pom.xml +++ b/jcommon/rcurve/pom.xml @@ -26,7 +26,7 @@ 4.0.0 rcurve - 1.4.2-SNAPSHOT + 1.4.2-jdk20-SNAPSHOT diff --git a/jcommon/rcurve/src/main/java/com/xiaomi/data/push/common/ExecutorServiceUtils.java b/jcommon/rcurve/src/main/java/com/xiaomi/data/push/common/ExecutorServiceUtils.java index 6d8f780b0..e56784561 100644 --- a/jcommon/rcurve/src/main/java/com/xiaomi/data/push/common/ExecutorServiceUtils.java +++ b/jcommon/rcurve/src/main/java/com/xiaomi/data/push/common/ExecutorServiceUtils.java @@ -14,28 +14,14 @@ public static ExecutorService creatThreadPool(int size, ExecutorService defaultP if (size <= 0) { return defaultPool; } - return new ThreadPoolExecutor(size, size, - 0L, TimeUnit.MILLISECONDS, - new ArrayBlockingQueue<>(100)); + return Executors.newVirtualThreadPerTaskExecutor(); } public static ExecutorService creatThreadPoolHasName(int size, String name, ExecutorService defaultPool) { if (size <= 0) { return defaultPool; } - return new ThreadPoolExecutor(size, size, - 0L, TimeUnit.MILLISECONDS, - new ArrayBlockingQueue<>(100), - new ThreadFactory() { - private final AtomicInteger id = new AtomicInteger(0); - - public Thread newThread(Runnable r) { - String threadName = name + this.id.getAndIncrement(); - Thread thread = new Thread(r, threadName); - thread.setDaemon(true); - return thread; - } - }); + return Executors.newVirtualThreadPerTaskExecutor(); } diff --git a/jcommon/rcurve/src/main/java/com/xiaomi/data/push/uds/UdsClient.java b/jcommon/rcurve/src/main/java/com/xiaomi/data/push/uds/UdsClient.java index eb3428097..beb3bf9e4 100644 --- a/jcommon/rcurve/src/main/java/com/xiaomi/data/push/uds/UdsClient.java +++ b/jcommon/rcurve/src/main/java/com/xiaomi/data/push/uds/UdsClient.java @@ -54,17 +54,7 @@ public class UdsClient implements IClient { private static UdsWheelTimer wheelTimer = new UdsWheelTimer(); - private ExecutorService pool = new ThreadPoolExecutor(200, 200, 0L, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<>(100), - new ThreadFactory() { - private final AtomicInteger id = new AtomicInteger(0); - - public Thread newThread(Runnable r) { - String threadName = "udsClient" + this.id.getAndIncrement(); - Thread thread = new Thread(r, threadName); - thread.setDaemon(true); - return thread; - } - }); + private ExecutorService pool = Executors.newVirtualThreadPerTaskExecutor(); @Getter private volatile Channel channel; diff --git a/jcommon/rcurve/src/main/java/com/xiaomi/data/push/uds/UdsServer.java b/jcommon/rcurve/src/main/java/com/xiaomi/data/push/uds/UdsServer.java index b41ab9031..2f3082769 100644 --- a/jcommon/rcurve/src/main/java/com/xiaomi/data/push/uds/UdsServer.java +++ b/jcommon/rcurve/src/main/java/com/xiaomi/data/push/uds/UdsServer.java @@ -56,19 +56,7 @@ public class UdsServer implements IServer { private ConcurrentHashMap> processorMap = new ConcurrentHashMap<>(); - private ExecutorService pool = new ThreadPoolExecutor(200, 200, - 0L, TimeUnit.MILLISECONDS, - new ArrayBlockingQueue<>(100), - new ThreadFactory() { - private final AtomicInteger id = new AtomicInteger(0); - - public Thread newThread(Runnable r) { - String threadName = "udsServer" + this.id.getAndIncrement(); - Thread thread = new Thread(r, threadName); - thread.setDaemon(true); - return thread; - } - }); + private ExecutorService pool = Executors.newVirtualThreadPerTaskExecutor(); /** * 是否使用remote模式(标准tcp) diff --git a/ozhera-all/ozhera-prometheus-agent/README.md b/ozhera-all/ozhera-prometheus-agent/README.md index 4bba659eb..e2b24c383 100644 --- a/ozhera-all/ozhera-prometheus-agent/README.md +++ b/ozhera-all/ozhera-prometheus-agent/README.md @@ -1 +1,2 @@ -# Overview \ No newline at end of file +# Overview +## ozhera-prometheus-agent diff --git a/ozhera-all/ozhera-prometheus-agent/ozhera-prometheus-agent-service/src/test/java/com/xiaomi/youpin/prometheus/agent/test/feishuCartTest.java b/ozhera-all/ozhera-prometheus-agent/ozhera-prometheus-agent-service/src/test/java/com/xiaomi/youpin/prometheus/agent/test/feishuCartTest.java index 1ac646ae3..61c293191 100644 --- a/ozhera-all/ozhera-prometheus-agent/ozhera-prometheus-agent-service/src/test/java/com/xiaomi/youpin/prometheus/agent/test/feishuCartTest.java +++ b/ozhera-all/ozhera-prometheus-agent/ozhera-prometheus-agent-service/src/test/java/com/xiaomi/youpin/prometheus/agent/test/feishuCartTest.java @@ -190,8 +190,8 @@ public void testFeishuInterfaceAlertCard() { try { String content = FreeMarkerUtil.getContent("/feishu", "feishuInterfalCart.ftl", map); System.out.println(content); - FeiShu feiShu = new FeiShu("cli_9ef18a2d8c74500e", "58eASBLGw9IqBFyds5m93m4GmTDYBMMt"); - feiShu.sendCardByEmail("zhangxiaowei6@xiaomi.com", content); + FeiShu feiShu = new FeiShu("xxx", "xxx"); + feiShu.sendCardByEmail("xxx", content); } catch (Exception e) { }