You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/07/13 15:03:42 UTC
[shardingsphere-elasticjob-lite] branch master updated: For code
style (#1051)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob-lite.git
The following commit(s) were added to refs/heads/master by this push:
new aa3f8a7 For code style (#1051)
aa3f8a7 is described below
commit aa3f8a73d3c1164b9227376b5d45a55b66425c9f
Author: Liang Zhang <te...@163.com>
AuthorDate: Mon Jul 13 23:03:32 2020 +0800
For code style (#1051)
* For code style
---
.../cloud/executor/DaemonTaskScheduler.java | 34 ++++++++++------------
.../elasticjob/cloud/scheduler/Bootstrap.java | 2 +-
2 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskScheduler.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskScheduler.java
index 758b47d..079c44a 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskScheduler.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskScheduler.java
@@ -162,24 +162,6 @@ public final class DaemonTaskScheduler {
private volatile ElasticJobExecutor jobExecutor;
- private ElasticJobExecutor getJobExecutor() {
- if (null == jobExecutor) {
- createJobExecutor();
- }
- return jobExecutor;
- }
-
- private synchronized void createJobExecutor() {
- if (null != jobExecutor) {
- return;
- }
- if (null == elasticJob) {
- jobExecutor = new ElasticJobExecutor(elasticJobType, jobFacade.loadJobConfiguration(true), jobFacade);
- } else {
- jobExecutor = new ElasticJobExecutor(elasticJob, jobFacade.loadJobConfiguration(true), jobFacade);
- }
- }
-
@Override
public void execute(final JobExecutionContext context) {
ShardingContexts shardingContexts = jobFacade.getShardingContexts();
@@ -197,5 +179,21 @@ public final class DaemonTaskScheduler {
shardingContexts.setCurrentJobEventSamplingCount(0);
}
}
+
+ private ElasticJobExecutor getJobExecutor() {
+ if (null == jobExecutor) {
+ createJobExecutor();
+ }
+ return jobExecutor;
+ }
+
+ private synchronized void createJobExecutor() {
+ if (null != jobExecutor) {
+ return;
+ }
+ jobExecutor = null == elasticJob
+ ? new ElasticJobExecutor(elasticJobType, jobFacade.loadJobConfiguration(true), jobFacade)
+ : new ElasticJobExecutor(elasticJob, jobFacade.loadJobConfiguration(true), jobFacade);
+ }
}
}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/Bootstrap.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/Bootstrap.java
index b204cfd..c6cc96b 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/Bootstrap.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/Bootstrap.java
@@ -54,7 +54,7 @@ public final class Bootstrap {
final CountDownLatch latch = new CountDownLatch(1);
latch.await();
Runtime.getRuntime().addShutdownHook(new Thread("shutdown-hook") {
-
+
@Override
public void run() {
electionService.stop();