You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/10 16:36:29 UTC
[GitHub] [shardingsphere-elasticjob] RedRed228 opened a new pull request, #2092: Each job has its own listener event notify thread instead of the only one curator thread
RedRed228 opened a new pull request, #2092:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/2092
Fixes #2038.
Changes proposed in this pull request:
- Add ListenerNotifierManager to manage job listener's notify thread executor. The thread executor is created for the job when
ListenerManager is constructed.
- Change CoordinatorRegistryCenter's watch method:
old: watch(String key, DataChangedEventListener listener) ;
new: watch(String key, DataChangedEventListener listener, Executor executor);
Each job now has its own event notify thread, thus no influence would occur between different jobs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] TeslaCN commented on a diff in pull request #2092: Each job has its own listener event notify thread instead of the only one curator thread
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on code in PR #2092:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/2092#discussion_r895273229
##########
elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java:
##########
@@ -408,20 +409,28 @@ public void executeInLeader(final String key, final LeaderExecutionCallback call
}
@Override
- public void watch(final String key, final DataChangedEventListener listener) {
+ public void watch(final String key, final DataChangedEventListener listener, final Executor executor) {
CuratorCache cache = caches.get(key + "/");
- cache.listenable().addListener((curatorType, oldData, newData) -> {
- if (null == newData && null == oldData) {
- return;
+ CuratorCacheListener cacheListener = new CuratorCacheListener() {
Review Comment:
Why change this to anonymous class?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] codecov-commenter commented on pull request #2092: Each job has its own listener event notify thread instead of the only one curator thread
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #2092:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/2092#issuecomment-1153598270
# [Codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2092](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5ec36da) into [master](https://codecov.io/gh/apache/shardingsphere-elasticjob/commit/9ddd708730bbb552bcc53280ebfcca29c910c053?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9ddd708) will **decrease** coverage by `0.05%`.
> The diff coverage is `75.00%`.
```diff
@@ Coverage Diff @@
## master #2092 +/- ##
============================================
- Coverage 85.08% 85.02% -0.06%
Complexity 144 144
============================================
Files 281 282 +1
Lines 6133 6157 +24
Branches 925 930 +5
============================================
+ Hits 5218 5235 +17
- Misses 569 572 +3
- Partials 346 350 +4
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...sticjob/lite/api/registry/JobInstanceRegistry.java](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZWxhc3RpY2pvYi1saXRlL2VsYXN0aWNqb2ItbGl0ZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbGFzdGljam9iL2xpdGUvYXBpL3JlZ2lzdHJ5L0pvYkluc3RhbmNlUmVnaXN0cnkuamF2YQ==) | `43.33% <0.00%> (-3.10%)` | :arrow_down: |
| [...sticjob/reg/zookeeper/ZookeeperRegistryCenter.java](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZWxhc3RpY2pvYi1pbmZyYS9lbGFzdGljam9iLXJlZ2lzdHJ5LWNlbnRlci9lbGFzdGljam9iLXJlZ2l0cnktY2VudGVyLXByb3ZpZGVyL2VsYXN0aWNqb2ItcmVnaXN0cnktY2VudGVyLXpvb2tlZXBlci1jdXJhdG9yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbGFzdGljam9iL3JlZy96b29rZWVwZXIvWm9va2VlcGVyUmVnaXN0cnlDZW50ZXIuamF2YQ==) | `63.44% <60.00%> (-0.50%)` | :arrow_down: |
| [...ite/internal/listener/ListenerNotifierManager.java](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZWxhc3RpY2pvYi1saXRlL2VsYXN0aWNqb2ItbGl0ZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbGFzdGljam9iL2xpdGUvaW50ZXJuYWwvbGlzdGVuZXIvTGlzdGVuZXJOb3RpZmllck1hbmFnZXIuamF2YQ==) | `88.23% <88.23%> (ø)` | |
| [...ticjob/lite/internal/listener/ListenerManager.java](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZWxhc3RpY2pvYi1saXRlL2VsYXN0aWNqb2ItbGl0ZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbGFzdGljam9iL2xpdGUvaW50ZXJuYWwvbGlzdGVuZXIvTGlzdGVuZXJNYW5hZ2VyLmphdmE=) | `100.00% <100.00%> (ø)` | |
| [...asticjob/lite/internal/storage/JobNodeStorage.java](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZWxhc3RpY2pvYi1saXRlL2VsYXN0aWNqb2ItbGl0ZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbGFzdGljam9iL2xpdGUvaW50ZXJuYWwvc3RvcmFnZS9Kb2JOb2RlU3RvcmFnZS5qYXZh) | `97.67% <100.00%> (+0.05%)` | :arrow_up: |
| [...ite/internal/election/ElectionListenerManager.java](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZWxhc3RpY2pvYi1saXRlL2VsYXN0aWNqb2ItbGl0ZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbGFzdGljam9iL2xpdGUvaW50ZXJuYWwvZWxlY3Rpb24vRWxlY3Rpb25MaXN0ZW5lck1hbmFnZXIuamF2YQ==) | `92.00% <0.00%> (-4.00%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9ddd708...5ec36da](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/2092?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] TeslaCN merged pull request #2092: Each job has its own listener event notify thread instead of the only one curator thread
Posted by GitBox <gi...@apache.org>.
TeslaCN merged PR #2092:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/2092
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] RedRed228 commented on a diff in pull request #2092: Each job has its own listener event notify thread instead of the only one curator thread
Posted by GitBox <gi...@apache.org>.
RedRed228 commented on code in PR #2092:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/2092#discussion_r895301492
##########
elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java:
##########
@@ -408,20 +409,28 @@ public void executeInLeader(final String key, final LeaderExecutionCallback call
}
@Override
- public void watch(final String key, final DataChangedEventListener listener) {
+ public void watch(final String key, final DataChangedEventListener listener, final Executor executor) {
CuratorCache cache = caches.get(key + "/");
- cache.listenable().addListener((curatorType, oldData, newData) -> {
- if (null == newData && null == oldData) {
- return;
+ CuratorCacheListener cacheListener = new CuratorCacheListener() {
Review Comment:
> Why change this to anonymous class?
I'm not familiar with lamda expression, so I use anonymous class to resuse the code. I can change it back to lamda expression.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org