Skip to content

Commit

Permalink
Merge branch 'XiaoMi:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
goodjava authored Sep 19, 2023
2 parents d7d1ca0 + 9de9766 commit afa0279
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 44 deletions.
2 changes: 1 addition & 1 deletion jcommon/rcurve/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>rcurve</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.4.2-jdk20-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,7 @@ public class UdsClient implements IClient<UdsCommand> {

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,7 @@ public class UdsServer implements IServer<UdsCommand> {

private ConcurrentHashMap<String, Pair<UdsProcessor, ExecutorService>> 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)
Expand Down
3 changes: 2 additions & 1 deletion ozhera-all/ozhera-prometheus-agent/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Overview
# Overview
## ozhera-prometheus-agent
Original file line number Diff line number Diff line change
Expand Up @@ -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("[email protected]", content);
FeiShu feiShu = new FeiShu("xxx", "xxx");
feiShu.sendCardByEmail("xxx", content);
} catch (Exception e) {

}
Expand Down

0 comments on commit afa0279

Please sign in to comment.