-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #483] Virtual thread compatible #489
Conversation
* @Create 2024/10/14 15:33 | ||
* @Version 1.0 | ||
*/ | ||
public class VirtualThreadExecutorAdapter implements ExecutorAdapter<ExecutorService>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否作为单独模块引入更好
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是指不实现ExecutorAdapter吗,感觉是属于adapter这个逻辑的。之前是想把ExecutorAdapter做一个重构,和yanhom哥聊过,说是目前不要改太多东西,重写的方法就空实现就好了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是指不实现ExecutorAdapter吗,感觉是属于adapter这个逻辑的。之前是想把ExecutorAdapter做一个重构,和yanhom哥聊过,说是目前不要改太多东西,重写的方法就空实现就好了
virtual thread是JDK21的,所以在想是否使用一个新模块来处理较好。不过简单来做应该也不用,做好版本判断
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是指不实现ExecutorAdapter吗,感觉是属于adapter这个逻辑的。之前是想把ExecutorAdapter做一个重构,和yanhom哥聊过,说是目前不要改太多东西,重写的方法就空实现就好了
virtual thread是JDK21的,所以在想是否使用一个新模块来处理较好。不过简单来做应该也不用,做好版本判断
确实感觉开个新模块会方便些,做重构的话也对以前的功能没有影响
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是指不实现ExecutorAdapter吗,感觉是属于adapter这个逻辑的。之前是想把ExecutorAdapter做一个重构,和yanhom哥聊过,说是目前不要改太多东西,重写的方法就空实现就好了
virtual thread是JDK21的,所以在想是否使用一个新模块来处理较好。不过简单来做应该也不用,做好版本判断
目前实现看也没依赖到jdk21的特性,还是基于ExecutorService体系来做的,放core也行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是指不实现ExecutorAdapter吗,感觉是属于adapter这个逻辑的。之前是想把ExecutorAdapter做一个重构,和yanhom哥聊过,说是目前不要改太多东西,重写的方法就空实现就好了
virtual thread是JDK21的,所以在想是否使用一个新模块来处理较好。不过简单来做应该也不用,做好版本判断
目前实现看也没依赖到jdk21的特性,还是基于ExecutorService体系来做的,放core也行
adapter里有点东西如果不依赖jdk21应该会报错,我看看能不能改改吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是指不实现ExecutorAdapter吗,感觉是属于adapter这个逻辑的。之前是想把ExecutorAdapter做一个重构,和yanhom哥聊过,说是目前不要改太多东西,重写的方法就空实现就好了
virtual thread是JDK21的,所以在想是否使用一个新模块来处理较好。不过简单来做应该也不用,做好版本判断
目前实现看也没依赖到jdk21的特性,还是基于ExecutorService体系来做的,放core也行
adapter里有点东西如果不依赖jdk21应该会报错,我看看能不能改改吧
有个VersionUtil工具类看看能不能处理下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是指不实现ExecutorAdapter吗,感觉是属于adapter这个逻辑的。之前是想把ExecutorAdapter做一个重构,和yanhom哥聊过,说是目前不要改太多东西,重写的方法就空实现就好了
virtual thread是JDK21的,所以在想是否使用一个新模块来处理较好。不过简单来做应该也不用,做好版本判断
目前实现看也没依赖到jdk21的特性,还是基于ExecutorService体系来做的,放core也行
adapter里有点东西如果不依赖jdk21应该会报错,我看看能不能改改吧
有个VersionUtil工具类看看能不能处理下
此pr是已经完成可以review了吗 |
核心兼容部分是已经实现了,现在正在做监控模块这部分。核心这块可以review了,监控这块也可以看一下,看看有没有啥建议 |
老哥监控这边基本做完了哈,但是还没做测试的,你可以先看看,到时我有空再测试一下。我留了一些保留字段到时可以用来做报警啥的 |
然后我这边实现的VirtualThreadExecutorProxy感觉耦合度有些高,你看看能不能有其他的实现方法 |
@KamToHung 这个pr你有空 review下 |
OK |
@@ -0,0 +1,98 @@ | |||
package org.dromara.dynamictp.common.entity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加上license-header
* Collect virtual thread key metrics. | ||
* @param vtTaskStats | ||
*/ | ||
void collect(VTExecutorStats vtTaskStats); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加了此接口后,完善下example的EsCollector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,你在本地测试正常吗,我这边测试自动扫描扫描不到bean不知道为什么,只能手动添加扫描路径
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,你在本地测试正常吗,我这边测试自动扫描扫描不到bean不知道为什么,只能手动添加扫描路径
我在test模块下测试的,可以启动
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,你在本地测试正常吗,我这边测试自动扫描扫描不到bean不知道为什么,只能手动添加扫描路径
我在test模块下测试的,可以启动
你用example 的nacos cloud试试呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,你在本地测试正常吗,我这边测试自动扫描扫描不到bean不知道为什么,只能手动添加扫描路径
我在test模块下测试的,可以启动
你用example 的nacos cloud试试呢
master分支的试了可以
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,你在本地测试正常吗,我这边测试自动扫描扫描不到bean不知道为什么,只能手动添加扫描路径
我在test模块下测试的,可以启动
你用example 的nacos cloud试试呢
master分支的试了可以
好的
*/ | ||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class VTExecutorStats extends Metrics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里感觉可以和ThreadPoolStats复用,不用定义一个?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个pr后还有些其他的参数可以监控和告警,这个类还得要,但是估计可以把公共的提出来吧
e29ebd4
to
40b89de
Compare
老哥有在群吗,加下好友聊下方案?感觉可以做得更内聚点 |
在的,待会我吃个饭就来加你哈 |
No description provided.