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/08/14 02:12:05 UTC
[GitHub] [shardingsphere] huangdx0726 opened a new pull request, #20159: Refactor RuleAlteredContextManagerLifecycleListener for common usage
huangdx0726 opened a new pull request, #20159:
URL: https://github.com/apache/shardingsphere/pull/20159
Fixes #20127 .
Changes proposed in this pull request:
- Rename RuleAlteredContextManagerLifecycleListener to PipelineContextManagerLifecycleListener
- Move PipelineContextManagerLifecycleListener to org.apache.shardingsphere.data.pipeline.core.listener package
- Add PipelineJobWorker class and Move initWorkerIfNecessary method from RuleAlteredJobWorker to PipelineJobWorker
--
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] codecov-commenter commented on pull request #20159: Refactor RuleAlteredContextManagerLifecycleListener for common usage
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #20159:
URL: https://github.com/apache/shardingsphere/pull/20159#issuecomment-1214273715
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/20159?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 [#20159](https://codecov.io/gh/apache/shardingsphere/pull/20159?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0024e63) into [master](https://codecov.io/gh/apache/shardingsphere/commit/9a85b941a4cf99ca1ff2413a63f621d4ce9c3975?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9a85b94) will **decrease** coverage by `0.00%`.
> The diff coverage is `0.00%`.
```diff
@@ Coverage Diff @@
## master #20159 +/- ##
============================================
- Coverage 60.51% 60.50% -0.01%
Complexity 2419 2419
============================================
Files 3868 3869 +1
Lines 54801 54803 +2
Branches 7682 7682
============================================
- Hits 33163 33160 -3
- Misses 18784 18789 +5
Partials 2854 2854
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/20159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...tener/PipelineContextManagerLifecycleListener.java](https://codecov.io/gh/apache/shardingsphere/pull/20159/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL2NvcmUvbGlzdGVuZXIvUGlwZWxpbmVDb250ZXh0TWFuYWdlckxpZmVjeWNsZUxpc3RlbmVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...peline/scenario/rulealtered/PipelineJobWorker.java](https://codecov.io/gh/apache/shardingsphere/pull/20159/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL3NjZW5hcmlvL3J1bGVhbHRlcmVkL1BpcGVsaW5lSm9iV29ya2VyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...ine/scenario/rulealtered/RuleAlteredJobWorker.java](https://codecov.io/gh/apache/shardingsphere/pull/20159/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL3NjZW5hcmlvL3J1bGVhbHRlcmVkL1J1bGVBbHRlcmVkSm9iV29ya2VyLmphdmE=) | `0.00% <ø> (ø)` | |
| [...handler/distsql/ral/hint/enums/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/20159/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL2hpbnQvZW51bXMvSGludFNvdXJjZVR5cGUuamF2YQ==) | `0.00% <0.00%> (-42.86%)` | :arrow_down: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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] sandynz commented on a diff in pull request #20159: Refactor RuleAlteredContextManagerLifecycleListener for common usage
Posted by GitBox <gi...@apache.org>.
sandynz commented on code in PR #20159:
URL: https://github.com/apache/shardingsphere/pull/20159#discussion_r945228097
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/PipelineJobWorker.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.data.pipeline.scenario.rulealtered;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.data.pipeline.core.context.PipelineContext;
+import org.apache.shardingsphere.data.pipeline.core.execute.FinishedCheckJobExecutor;
+import org.apache.shardingsphere.data.pipeline.core.execute.PipelineJobExecutor;
+
+/**
+ * Pipeline job worker.
+ */
+@Slf4j
+public final class PipelineJobWorker {
+
+ private static final PipelineJobWorker INSTANCE = new PipelineJobWorker();
+
+ private static final AtomicBoolean WORKER_INITIALIZED = new AtomicBoolean(false);
+
+ /**
+ * Initialize job worker if necessary.
+ */
+ public static void initWorkerIfNecessary() {
+ if (WORKER_INITIALIZED.get()) {
+ return;
+ }
+ synchronized (WORKER_INITIALIZED) {
+ if (WORKER_INITIALIZED.get()) {
+ return;
+ }
+ log.info("start worker initialization");
+ PipelineContext.getContextManager().getInstanceContext().getEventBusContext().register(INSTANCE);
Review Comment:
About `PipelineContext.getContextManager().getInstanceContext().getEventBusContext().register(INSTANCE);`, it still need to register RuleAlteredJobWorker instance, since the `@Subscribe` still in RuleAlteredJobWorker. This is why CI ran failed.
```
PipelineContext.getContextManager().getInstanceContext().getEventBusContext().register(RuleAlteredJobWorker.getInstance());
```
RuleAlteredJobWorker will be refactor later.
--
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] sandynz merged pull request #20159: Refactor RuleAlteredContextManagerLifecycleListener for common usage
Posted by GitBox <gi...@apache.org>.
sandynz merged PR #20159:
URL: https://github.com/apache/shardingsphere/pull/20159
--
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